@girs/glib-2.0 2.77.0-3.2.2 → 2.78.0-3.2.5
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 +14 -1
- package/glib-2.0-ambient.d.ts +0 -1
- package/glib-2.0-import.d.ts +0 -1
- package/glib-2.0.d.cts +103 -24
- package/glib-2.0.d.ts +103 -24
- 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.
|
|
8
|
+
GJS TypeScript type definitions for GLib-2.0, generated from library version 2.78.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.5.
|
|
9
9
|
|
|
10
10
|
GLib provides the core application building blocks for libraries and applications written in C. It provides the core object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common data structures.
|
|
11
11
|
|
|
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
|
|
|
82
82
|
const GLib = imports.gi.GLib;
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
|
|
86
|
+
### ESM vs. CommonJS
|
|
87
|
+
|
|
88
|
+
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
89
|
+
|
|
90
|
+
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
91
|
+
|
|
92
|
+
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
93
|
+
|
|
94
|
+
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
95
|
+
|
|
96
|
+
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
97
|
+
|
|
85
98
|
### Bundle
|
|
86
99
|
|
|
87
100
|
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
package/glib-2.0-ambient.d.ts
CHANGED
package/glib-2.0-import.d.ts
CHANGED
package/glib-2.0.d.cts
CHANGED
|
@@ -6432,6 +6432,11 @@ export function filename_display_name(filename: string): string | null
|
|
|
6432
6432
|
/**
|
|
6433
6433
|
* Converts an escaped ASCII-encoded URI to a local filename in the
|
|
6434
6434
|
* encoding used for filenames.
|
|
6435
|
+
*
|
|
6436
|
+
* Since GLib 2.78, the query string and fragment can be present in the URI,
|
|
6437
|
+
* but are not part of the resulting filename.
|
|
6438
|
+
* We take inspiration from https://url.spec.whatwg.org/#file-state,
|
|
6439
|
+
* but we don't support the entire standard.
|
|
6435
6440
|
* @param uri a uri describing a filename (escaped, encoded in ASCII).
|
|
6436
6441
|
* @returns a newly-allocated string holding the resulting filename, or %NULL on an error.
|
|
6437
6442
|
*/
|
|
@@ -9188,7 +9193,7 @@ export function spaced_primes_closest(num: number): number
|
|
|
9188
9193
|
* @param argv child's argument vector
|
|
9189
9194
|
* @param envp child's environment, or %NULL to inherit parent's
|
|
9190
9195
|
* @param flags flags from #GSpawnFlags
|
|
9191
|
-
* @param child_setup function to run
|
|
9196
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9192
9197
|
* @returns %TRUE on success, %FALSE if error is set
|
|
9193
9198
|
*/
|
|
9194
9199
|
export function spawn_async(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* child_pid */ Pid ]
|
|
@@ -9201,7 +9206,7 @@ export function spawn_async(working_directory: string | null, argv: string[], en
|
|
|
9201
9206
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9202
9207
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9203
9208
|
* @param flags flags from #GSpawnFlags
|
|
9204
|
-
* @param child_setup function to run
|
|
9209
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9205
9210
|
* @param stdin_fd file descriptor to use for child's stdin, or `-1`
|
|
9206
9211
|
* @param stdout_fd file descriptor to use for child's stdout, or `-1`
|
|
9207
9212
|
* @param stderr_fd file descriptor to use for child's stderr, or `-1`
|
|
@@ -9215,7 +9220,7 @@ export function spawn_async_with_fds(working_directory: string | null, argv: str
|
|
|
9215
9220
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9216
9221
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9217
9222
|
* @param flags flags from #GSpawnFlags
|
|
9218
|
-
* @param child_setup function to run
|
|
9223
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9219
9224
|
* @returns %TRUE on success, %FALSE if an error was set
|
|
9220
9225
|
*/
|
|
9221
9226
|
export function spawn_async_with_pipes(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* child_pid */ Pid, /* standard_input */ number, /* standard_output */ number, /* standard_error */ number ]
|
|
@@ -9418,7 +9423,7 @@ export function spawn_async_with_pipes(working_directory: string | null, argv: s
|
|
|
9418
9423
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9419
9424
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9420
9425
|
* @param flags flags from #GSpawnFlags
|
|
9421
|
-
* @param child_setup function to run
|
|
9426
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9422
9427
|
* @param stdin_fd file descriptor to use for child's stdin, or `-1`
|
|
9423
9428
|
* @param stdout_fd file descriptor to use for child's stdout, or `-1`
|
|
9424
9429
|
* @param stderr_fd file descriptor to use for child's stderr, or `-1`
|
|
@@ -9571,7 +9576,7 @@ export function spawn_exit_error_quark(): Quark
|
|
|
9571
9576
|
* @param argv child's argument vector, which must be non-empty and %NULL-terminated
|
|
9572
9577
|
* @param envp child's environment, or %NULL to inherit parent's
|
|
9573
9578
|
* @param flags flags from #GSpawnFlags
|
|
9574
|
-
* @param child_setup function to run
|
|
9579
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9575
9580
|
* @returns %TRUE on success, %FALSE if an error was set
|
|
9576
9581
|
*/
|
|
9577
9582
|
export function spawn_sync(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* standard_output */ Uint8Array, /* standard_error */ Uint8Array, /* wait_status */ number ]
|
|
@@ -10018,6 +10023,55 @@ export function strrstr_len(haystack: string | null, haystack_len: number, needl
|
|
|
10018
10023
|
* @returns a UTF-8 string describing the signal. If the signal is unknown, it returns "unknown signal (<signum>)".
|
|
10019
10024
|
*/
|
|
10020
10025
|
export function strsignal(signum: number): string | null
|
|
10026
|
+
/**
|
|
10027
|
+
* Splits a string into a maximum of `max_tokens` pieces, using the given
|
|
10028
|
+
* `delimiter`. If `max_tokens` is reached, the remainder of `string` is
|
|
10029
|
+
* appended to the last token.
|
|
10030
|
+
*
|
|
10031
|
+
* As an example, the result of g_strsplit (":a:bc::d:", ":", -1) is a
|
|
10032
|
+
* %NULL-terminated vector containing the six strings "", "a", "bc", "", "d"
|
|
10033
|
+
* and "".
|
|
10034
|
+
*
|
|
10035
|
+
* As a special case, the result of splitting the empty string "" is an empty
|
|
10036
|
+
* vector, not a vector containing a single string. The reason for this
|
|
10037
|
+
* special case is that being able to represent an empty vector is typically
|
|
10038
|
+
* more useful than consistent handling of empty elements. If you do need
|
|
10039
|
+
* to represent empty elements, you'll need to check for the empty string
|
|
10040
|
+
* before calling g_strsplit().
|
|
10041
|
+
* @param string a string to split
|
|
10042
|
+
* @param delimiter a string which specifies the places at which to split the string. The delimiter is not included in any of the resulting strings, unless `max_tokens` is reached.
|
|
10043
|
+
* @param max_tokens the maximum number of pieces to split `string` into. If this is less than 1, the string is split completely.
|
|
10044
|
+
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
10045
|
+
*/
|
|
10046
|
+
export function strsplit(string: string | null, delimiter: string | null, max_tokens: number): string[]
|
|
10047
|
+
/**
|
|
10048
|
+
* Splits `string` into a number of tokens not containing any of the characters
|
|
10049
|
+
* in `delimiter`. A token is the (possibly empty) longest string that does not
|
|
10050
|
+
* contain any of the characters in `delimiters`. If `max_tokens` is reached, the
|
|
10051
|
+
* remainder is appended to the last token.
|
|
10052
|
+
*
|
|
10053
|
+
* For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
|
|
10054
|
+
* %NULL-terminated vector containing the three strings "abc", "def",
|
|
10055
|
+
* and "ghi".
|
|
10056
|
+
*
|
|
10057
|
+
* The result of g_strsplit_set (":def/ghi:", ":/", -1) is a %NULL-terminated
|
|
10058
|
+
* vector containing the four strings "", "def", "ghi", and "".
|
|
10059
|
+
*
|
|
10060
|
+
* As a special case, the result of splitting the empty string "" is an empty
|
|
10061
|
+
* vector, not a vector containing a single string. The reason for this
|
|
10062
|
+
* special case is that being able to represent an empty vector is typically
|
|
10063
|
+
* more useful than consistent handling of empty elements. If you do need
|
|
10064
|
+
* to represent empty elements, you'll need to check for the empty string
|
|
10065
|
+
* before calling g_strsplit_set().
|
|
10066
|
+
*
|
|
10067
|
+
* Note that this function works on bytes not characters, so it can't be used
|
|
10068
|
+
* to delimit UTF-8 strings for anything but ASCII characters.
|
|
10069
|
+
* @param string The string to be tokenized
|
|
10070
|
+
* @param delimiters A nul-terminated string containing bytes that are used to split the string (it can accept an empty string, which will result in no string splitting).
|
|
10071
|
+
* @param max_tokens The maximum number of tokens to split `string` into. If this is less than 1, the string is split completely
|
|
10072
|
+
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
10073
|
+
*/
|
|
10074
|
+
export function strsplit_set(string: string | null, delimiters: string | null, max_tokens: number): string[]
|
|
10021
10075
|
/**
|
|
10022
10076
|
* Searches the string `haystack` for the first occurrence
|
|
10023
10077
|
* of the string `needle,` limiting the length of the search
|
|
@@ -10154,6 +10208,14 @@ export function test_bug(bug_uri_snippet: string | null): void
|
|
|
10154
10208
|
* @param uri_pattern the base pattern for bug URIs
|
|
10155
10209
|
*/
|
|
10156
10210
|
export function test_bug_base(uri_pattern: string | null): void
|
|
10211
|
+
/**
|
|
10212
|
+
* Attempt to disable system crash reporting infrastructure.
|
|
10213
|
+
*
|
|
10214
|
+
* This function should be called before exercising code paths that are
|
|
10215
|
+
* expected or intended to crash, to avoid wasting resources in system-wide
|
|
10216
|
+
* crash collection infrastructure such as systemd-coredump or abrt.
|
|
10217
|
+
*/
|
|
10218
|
+
export function test_disable_crash_reporting(): void
|
|
10157
10219
|
/**
|
|
10158
10220
|
* Indicates that a message with the given `log_domain` and `log_level,`
|
|
10159
10221
|
* with text matching `pattern,` is expected to be logged. When this
|
|
@@ -10522,6 +10584,11 @@ export function test_trap_reached_timeout(): boolean
|
|
|
10522
10584
|
* the subprocess, you can call g_test_subprocess() (after calling
|
|
10523
10585
|
* g_test_init()) to see whether you are in a subprocess.
|
|
10524
10586
|
*
|
|
10587
|
+
* Internally, this function tracks the child process using
|
|
10588
|
+
* g_child_watch_source_new(), so your process must not ignore `SIGCHLD`, and
|
|
10589
|
+
* must not attempt to watch or wait for the child process via another
|
|
10590
|
+
* mechanism.
|
|
10591
|
+
*
|
|
10525
10592
|
* The following example tests that calling
|
|
10526
10593
|
* `my_object_new(1000000)` will abort with an error
|
|
10527
10594
|
* message.
|
|
@@ -10978,10 +11045,9 @@ export function unichar_fully_decompose(ch: string, compat: boolean, result_len:
|
|
|
10978
11045
|
* glyph and `mirrored_ch` is set, it puts that character in the address
|
|
10979
11046
|
* pointed to by `mirrored_ch`. Otherwise the original character is put.
|
|
10980
11047
|
* @param ch a Unicode character
|
|
10981
|
-
* @param mirrored_ch location to store the mirrored character
|
|
10982
11048
|
* @returns %TRUE if @ch has a mirrored character, %FALSE otherwise
|
|
10983
11049
|
*/
|
|
10984
|
-
export function unichar_get_mirror_char(ch: string, mirrored_ch
|
|
11050
|
+
export function unichar_get_mirror_char(ch: string): [ /* returnType */ boolean, /* mirrored_ch */ string ]
|
|
10985
11051
|
/**
|
|
10986
11052
|
* Looks up the #GUnicodeScript for a particular character (as defined
|
|
10987
11053
|
* by Unicode Standard Annex \#24). No check is made for `ch` being a
|
|
@@ -11290,15 +11356,18 @@ export function unix_get_passwd_entry(user_name: string | null): any | null
|
|
|
11290
11356
|
* uses the pipe2() system call, which atomically creates a pipe with
|
|
11291
11357
|
* the configured flags.
|
|
11292
11358
|
*
|
|
11293
|
-
* As of GLib 2.78, the supported flags are `FD_CLOEXEC`
|
|
11294
|
-
* to GLib 2.78, only `FD_CLOEXEC` was supported — if
|
|
11295
|
-
* `O_NONBLOCK` then that had to be done separately with
|
|
11359
|
+
* As of GLib 2.78, the supported flags are `O_CLOEXEC`/`FD_CLOEXEC` (see below)
|
|
11360
|
+
* and `O_NONBLOCK`. Prior to GLib 2.78, only `FD_CLOEXEC` was supported — if
|
|
11361
|
+
* you wanted to configure `O_NONBLOCK` then that had to be done separately with
|
|
11362
|
+
* `fcntl()`.
|
|
11296
11363
|
*
|
|
11297
11364
|
* It is a programmer error to call this function with unsupported flags, and a
|
|
11298
11365
|
* critical warning will be raised.
|
|
11299
11366
|
*
|
|
11300
|
-
*
|
|
11301
|
-
*
|
|
11367
|
+
* As of GLib 2.78, it is preferred to pass `O_CLOEXEC` in, rather than
|
|
11368
|
+
* `FD_CLOEXEC`, as that matches the underlying `pipe()` API more closely. Prior
|
|
11369
|
+
* to 2.78, only `FD_CLOEXEC` was supported. Support for `FD_CLOEXEC` may be
|
|
11370
|
+
* deprecated and removed in future.
|
|
11302
11371
|
* @param fds Array of two integers
|
|
11303
11372
|
* @param flags Bitfield of file descriptor flags, as for fcntl()
|
|
11304
11373
|
* @returns %TRUE on success, %FALSE if not (and errno will be set).
|
|
@@ -19133,13 +19202,13 @@ export interface OptionEntry {
|
|
|
19133
19202
|
* called to handle the extra argument. Otherwise, `arg_data` is a
|
|
19134
19203
|
* pointer to a location to store the value, the required type of
|
|
19135
19204
|
* the location depends on the `arg` type:
|
|
19136
|
-
*
|
|
19137
|
-
*
|
|
19138
|
-
*
|
|
19139
|
-
*
|
|
19140
|
-
*
|
|
19141
|
-
*
|
|
19142
|
-
*
|
|
19205
|
+
* - %G_OPTION_ARG_NONE: %gboolean
|
|
19206
|
+
* - %G_OPTION_ARG_STRING: %gchar*
|
|
19207
|
+
* - %G_OPTION_ARG_INT: %gint
|
|
19208
|
+
* - %G_OPTION_ARG_FILENAME: %gchar*
|
|
19209
|
+
* - %G_OPTION_ARG_STRING_ARRAY: %gchar**
|
|
19210
|
+
* - %G_OPTION_ARG_FILENAME_ARRAY: %gchar**
|
|
19211
|
+
* - %G_OPTION_ARG_DOUBLE: %gdouble
|
|
19143
19212
|
* If `arg` type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME,
|
|
19144
19213
|
* the location will contain a newly allocated string if the option
|
|
19145
19214
|
* was given. That string needs to be freed by the callee using g_free().
|
|
@@ -19241,6 +19310,11 @@ export class OptionGroup {
|
|
|
19241
19310
|
|
|
19242
19311
|
/**
|
|
19243
19312
|
* Creates a new #GOptionGroup.
|
|
19313
|
+
*
|
|
19314
|
+
* `description` is typically used to provide a title for the group. If so, it
|
|
19315
|
+
* is recommended that it’s written in title case, and has a trailing colon so
|
|
19316
|
+
* that it matches the style of built-in GLib group titles such as
|
|
19317
|
+
* ‘Application Options:’.
|
|
19244
19318
|
* @constructor
|
|
19245
19319
|
* @param name the name for the option group, this is used to provide help for the options in this group with `--help-``name`
|
|
19246
19320
|
* @param description a description for this group to be shown in `--help`. This string is translated using the translation domain or translation function of the group
|
|
@@ -19252,6 +19326,11 @@ export class OptionGroup {
|
|
|
19252
19326
|
constructor(name: string | null, description: string | null, help_description: string | null, user_data: any | null, destroy: DestroyNotify | null)
|
|
19253
19327
|
/**
|
|
19254
19328
|
* Creates a new #GOptionGroup.
|
|
19329
|
+
*
|
|
19330
|
+
* `description` is typically used to provide a title for the group. If so, it
|
|
19331
|
+
* is recommended that it’s written in title case, and has a trailing colon so
|
|
19332
|
+
* that it matches the style of built-in GLib group titles such as
|
|
19333
|
+
* ‘Application Options:’.
|
|
19255
19334
|
* @constructor
|
|
19256
19335
|
* @param name the name for the option group, this is used to provide help for the options in this group with `--help-``name`
|
|
19257
19336
|
* @param description a description for this group to be shown in `--help`. This string is translated using the translation domain or translation function of the group
|
|
@@ -23481,9 +23560,9 @@ export interface Tree {
|
|
|
23481
23560
|
* are O(log(n)).
|
|
23482
23561
|
* @param key the key to insert
|
|
23483
23562
|
* @param value the value corresponding to the key
|
|
23484
|
-
* @returns the inserted (or set) node.
|
|
23563
|
+
* @returns the inserted (or set) node or %NULL if insertion would overflow the tree node counter.
|
|
23485
23564
|
*/
|
|
23486
|
-
insert_node(key: any | null, value: any | null): TreeNode
|
|
23565
|
+
insert_node(key: any | null, value: any | null): TreeNode | null
|
|
23487
23566
|
/**
|
|
23488
23567
|
* Gets the value corresponding to the given key. Since a #GTree is
|
|
23489
23568
|
* automatically balanced as key/value pairs are added, key lookup
|
|
@@ -23522,7 +23601,7 @@ export interface Tree {
|
|
|
23522
23601
|
lower_bound(key: any | null): TreeNode | null
|
|
23523
23602
|
/**
|
|
23524
23603
|
* Gets the number of nodes in a #GTree.
|
|
23525
|
-
* @returns the number of nodes in @tree
|
|
23604
|
+
* @returns the number of nodes in @tree The node counter value type is really a #guint, but it is returned as a #gint due to backward compatibility issues (can be cast back to #guint to support its full range of values).
|
|
23526
23605
|
*/
|
|
23527
23606
|
nnodes(): number
|
|
23528
23607
|
/**
|
|
@@ -23583,9 +23662,9 @@ export interface Tree {
|
|
|
23583
23662
|
* so that the distance from the root to every leaf is as small as possible.
|
|
23584
23663
|
* @param key the key to insert
|
|
23585
23664
|
* @param value the value corresponding to the key
|
|
23586
|
-
* @returns the inserted (or set) node.
|
|
23665
|
+
* @returns the inserted (or set) node or %NULL if insertion would overflow the tree node counter.
|
|
23587
23666
|
*/
|
|
23588
|
-
replace_node(key: any | null, value: any | null): TreeNode
|
|
23667
|
+
replace_node(key: any | null, value: any | null): TreeNode | null
|
|
23589
23668
|
/**
|
|
23590
23669
|
* Removes a key and its associated value from a #GTree without calling
|
|
23591
23670
|
* the key and value destroy functions.
|
package/glib-2.0.d.ts
CHANGED
|
@@ -6434,6 +6434,11 @@ function filename_display_name(filename: string): string | null
|
|
|
6434
6434
|
/**
|
|
6435
6435
|
* Converts an escaped ASCII-encoded URI to a local filename in the
|
|
6436
6436
|
* encoding used for filenames.
|
|
6437
|
+
*
|
|
6438
|
+
* Since GLib 2.78, the query string and fragment can be present in the URI,
|
|
6439
|
+
* but are not part of the resulting filename.
|
|
6440
|
+
* We take inspiration from https://url.spec.whatwg.org/#file-state,
|
|
6441
|
+
* but we don't support the entire standard.
|
|
6437
6442
|
* @param uri a uri describing a filename (escaped, encoded in ASCII).
|
|
6438
6443
|
* @returns a newly-allocated string holding the resulting filename, or %NULL on an error.
|
|
6439
6444
|
*/
|
|
@@ -9190,7 +9195,7 @@ function spaced_primes_closest(num: number): number
|
|
|
9190
9195
|
* @param argv child's argument vector
|
|
9191
9196
|
* @param envp child's environment, or %NULL to inherit parent's
|
|
9192
9197
|
* @param flags flags from #GSpawnFlags
|
|
9193
|
-
* @param child_setup function to run
|
|
9198
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9194
9199
|
* @returns %TRUE on success, %FALSE if error is set
|
|
9195
9200
|
*/
|
|
9196
9201
|
function spawn_async(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* child_pid */ Pid ]
|
|
@@ -9203,7 +9208,7 @@ function spawn_async(working_directory: string | null, argv: string[], envp: str
|
|
|
9203
9208
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9204
9209
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9205
9210
|
* @param flags flags from #GSpawnFlags
|
|
9206
|
-
* @param child_setup function to run
|
|
9211
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9207
9212
|
* @param stdin_fd file descriptor to use for child's stdin, or `-1`
|
|
9208
9213
|
* @param stdout_fd file descriptor to use for child's stdout, or `-1`
|
|
9209
9214
|
* @param stderr_fd file descriptor to use for child's stderr, or `-1`
|
|
@@ -9217,7 +9222,7 @@ function spawn_async_with_fds(working_directory: string | null, argv: string[],
|
|
|
9217
9222
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9218
9223
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9219
9224
|
* @param flags flags from #GSpawnFlags
|
|
9220
|
-
* @param child_setup function to run
|
|
9225
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9221
9226
|
* @returns %TRUE on success, %FALSE if an error was set
|
|
9222
9227
|
*/
|
|
9223
9228
|
function spawn_async_with_pipes(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* child_pid */ Pid, /* standard_input */ number, /* standard_output */ number, /* standard_error */ number ]
|
|
@@ -9420,7 +9425,7 @@ function spawn_async_with_pipes(working_directory: string | null, argv: string[]
|
|
|
9420
9425
|
* @param argv child's argument vector, in the GLib file name encoding; it must be non-empty and %NULL-terminated
|
|
9421
9426
|
* @param envp child's environment, or %NULL to inherit parent's, in the GLib file name encoding
|
|
9422
9427
|
* @param flags flags from #GSpawnFlags
|
|
9423
|
-
* @param child_setup function to run
|
|
9428
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9424
9429
|
* @param stdin_fd file descriptor to use for child's stdin, or `-1`
|
|
9425
9430
|
* @param stdout_fd file descriptor to use for child's stdout, or `-1`
|
|
9426
9431
|
* @param stderr_fd file descriptor to use for child's stderr, or `-1`
|
|
@@ -9573,7 +9578,7 @@ function spawn_exit_error_quark(): Quark
|
|
|
9573
9578
|
* @param argv child's argument vector, which must be non-empty and %NULL-terminated
|
|
9574
9579
|
* @param envp child's environment, or %NULL to inherit parent's
|
|
9575
9580
|
* @param flags flags from #GSpawnFlags
|
|
9576
|
-
* @param child_setup function to run
|
|
9581
|
+
* @param child_setup function to run in the child just before `exec()`
|
|
9577
9582
|
* @returns %TRUE on success, %FALSE if an error was set
|
|
9578
9583
|
*/
|
|
9579
9584
|
function spawn_sync(working_directory: string | null, argv: string[], envp: string[] | null, flags: SpawnFlags, child_setup: SpawnChildSetupFunc | null): [ /* returnType */ boolean, /* standard_output */ Uint8Array, /* standard_error */ Uint8Array, /* wait_status */ number ]
|
|
@@ -10020,6 +10025,55 @@ function strrstr_len(haystack: string | null, haystack_len: number, needle: stri
|
|
|
10020
10025
|
* @returns a UTF-8 string describing the signal. If the signal is unknown, it returns "unknown signal (<signum>)".
|
|
10021
10026
|
*/
|
|
10022
10027
|
function strsignal(signum: number): string | null
|
|
10028
|
+
/**
|
|
10029
|
+
* Splits a string into a maximum of `max_tokens` pieces, using the given
|
|
10030
|
+
* `delimiter`. If `max_tokens` is reached, the remainder of `string` is
|
|
10031
|
+
* appended to the last token.
|
|
10032
|
+
*
|
|
10033
|
+
* As an example, the result of g_strsplit (":a:bc::d:", ":", -1) is a
|
|
10034
|
+
* %NULL-terminated vector containing the six strings "", "a", "bc", "", "d"
|
|
10035
|
+
* and "".
|
|
10036
|
+
*
|
|
10037
|
+
* As a special case, the result of splitting the empty string "" is an empty
|
|
10038
|
+
* vector, not a vector containing a single string. The reason for this
|
|
10039
|
+
* special case is that being able to represent an empty vector is typically
|
|
10040
|
+
* more useful than consistent handling of empty elements. If you do need
|
|
10041
|
+
* to represent empty elements, you'll need to check for the empty string
|
|
10042
|
+
* before calling g_strsplit().
|
|
10043
|
+
* @param string a string to split
|
|
10044
|
+
* @param delimiter a string which specifies the places at which to split the string. The delimiter is not included in any of the resulting strings, unless `max_tokens` is reached.
|
|
10045
|
+
* @param max_tokens the maximum number of pieces to split `string` into. If this is less than 1, the string is split completely.
|
|
10046
|
+
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
10047
|
+
*/
|
|
10048
|
+
function strsplit(string: string | null, delimiter: string | null, max_tokens: number): string[]
|
|
10049
|
+
/**
|
|
10050
|
+
* Splits `string` into a number of tokens not containing any of the characters
|
|
10051
|
+
* in `delimiter`. A token is the (possibly empty) longest string that does not
|
|
10052
|
+
* contain any of the characters in `delimiters`. If `max_tokens` is reached, the
|
|
10053
|
+
* remainder is appended to the last token.
|
|
10054
|
+
*
|
|
10055
|
+
* For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
|
|
10056
|
+
* %NULL-terminated vector containing the three strings "abc", "def",
|
|
10057
|
+
* and "ghi".
|
|
10058
|
+
*
|
|
10059
|
+
* The result of g_strsplit_set (":def/ghi:", ":/", -1) is a %NULL-terminated
|
|
10060
|
+
* vector containing the four strings "", "def", "ghi", and "".
|
|
10061
|
+
*
|
|
10062
|
+
* As a special case, the result of splitting the empty string "" is an empty
|
|
10063
|
+
* vector, not a vector containing a single string. The reason for this
|
|
10064
|
+
* special case is that being able to represent an empty vector is typically
|
|
10065
|
+
* more useful than consistent handling of empty elements. If you do need
|
|
10066
|
+
* to represent empty elements, you'll need to check for the empty string
|
|
10067
|
+
* before calling g_strsplit_set().
|
|
10068
|
+
*
|
|
10069
|
+
* Note that this function works on bytes not characters, so it can't be used
|
|
10070
|
+
* to delimit UTF-8 strings for anything but ASCII characters.
|
|
10071
|
+
* @param string The string to be tokenized
|
|
10072
|
+
* @param delimiters A nul-terminated string containing bytes that are used to split the string (it can accept an empty string, which will result in no string splitting).
|
|
10073
|
+
* @param max_tokens The maximum number of tokens to split `string` into. If this is less than 1, the string is split completely
|
|
10074
|
+
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
10075
|
+
*/
|
|
10076
|
+
function strsplit_set(string: string | null, delimiters: string | null, max_tokens: number): string[]
|
|
10023
10077
|
/**
|
|
10024
10078
|
* Searches the string `haystack` for the first occurrence
|
|
10025
10079
|
* of the string `needle,` limiting the length of the search
|
|
@@ -10156,6 +10210,14 @@ function test_bug(bug_uri_snippet: string | null): void
|
|
|
10156
10210
|
* @param uri_pattern the base pattern for bug URIs
|
|
10157
10211
|
*/
|
|
10158
10212
|
function test_bug_base(uri_pattern: string | null): void
|
|
10213
|
+
/**
|
|
10214
|
+
* Attempt to disable system crash reporting infrastructure.
|
|
10215
|
+
*
|
|
10216
|
+
* This function should be called before exercising code paths that are
|
|
10217
|
+
* expected or intended to crash, to avoid wasting resources in system-wide
|
|
10218
|
+
* crash collection infrastructure such as systemd-coredump or abrt.
|
|
10219
|
+
*/
|
|
10220
|
+
function test_disable_crash_reporting(): void
|
|
10159
10221
|
/**
|
|
10160
10222
|
* Indicates that a message with the given `log_domain` and `log_level,`
|
|
10161
10223
|
* with text matching `pattern,` is expected to be logged. When this
|
|
@@ -10524,6 +10586,11 @@ function test_trap_reached_timeout(): boolean
|
|
|
10524
10586
|
* the subprocess, you can call g_test_subprocess() (after calling
|
|
10525
10587
|
* g_test_init()) to see whether you are in a subprocess.
|
|
10526
10588
|
*
|
|
10589
|
+
* Internally, this function tracks the child process using
|
|
10590
|
+
* g_child_watch_source_new(), so your process must not ignore `SIGCHLD`, and
|
|
10591
|
+
* must not attempt to watch or wait for the child process via another
|
|
10592
|
+
* mechanism.
|
|
10593
|
+
*
|
|
10527
10594
|
* The following example tests that calling
|
|
10528
10595
|
* `my_object_new(1000000)` will abort with an error
|
|
10529
10596
|
* message.
|
|
@@ -10980,10 +11047,9 @@ function unichar_fully_decompose(ch: string, compat: boolean, result_len: number
|
|
|
10980
11047
|
* glyph and `mirrored_ch` is set, it puts that character in the address
|
|
10981
11048
|
* pointed to by `mirrored_ch`. Otherwise the original character is put.
|
|
10982
11049
|
* @param ch a Unicode character
|
|
10983
|
-
* @param mirrored_ch location to store the mirrored character
|
|
10984
11050
|
* @returns %TRUE if @ch has a mirrored character, %FALSE otherwise
|
|
10985
11051
|
*/
|
|
10986
|
-
function unichar_get_mirror_char(ch: string, mirrored_ch
|
|
11052
|
+
function unichar_get_mirror_char(ch: string): [ /* returnType */ boolean, /* mirrored_ch */ string ]
|
|
10987
11053
|
/**
|
|
10988
11054
|
* Looks up the #GUnicodeScript for a particular character (as defined
|
|
10989
11055
|
* by Unicode Standard Annex \#24). No check is made for `ch` being a
|
|
@@ -11292,15 +11358,18 @@ function unix_get_passwd_entry(user_name: string | null): any | null
|
|
|
11292
11358
|
* uses the pipe2() system call, which atomically creates a pipe with
|
|
11293
11359
|
* the configured flags.
|
|
11294
11360
|
*
|
|
11295
|
-
* As of GLib 2.78, the supported flags are `FD_CLOEXEC`
|
|
11296
|
-
* to GLib 2.78, only `FD_CLOEXEC` was supported — if
|
|
11297
|
-
* `O_NONBLOCK` then that had to be done separately with
|
|
11361
|
+
* As of GLib 2.78, the supported flags are `O_CLOEXEC`/`FD_CLOEXEC` (see below)
|
|
11362
|
+
* and `O_NONBLOCK`. Prior to GLib 2.78, only `FD_CLOEXEC` was supported — if
|
|
11363
|
+
* you wanted to configure `O_NONBLOCK` then that had to be done separately with
|
|
11364
|
+
* `fcntl()`.
|
|
11298
11365
|
*
|
|
11299
11366
|
* It is a programmer error to call this function with unsupported flags, and a
|
|
11300
11367
|
* critical warning will be raised.
|
|
11301
11368
|
*
|
|
11302
|
-
*
|
|
11303
|
-
*
|
|
11369
|
+
* As of GLib 2.78, it is preferred to pass `O_CLOEXEC` in, rather than
|
|
11370
|
+
* `FD_CLOEXEC`, as that matches the underlying `pipe()` API more closely. Prior
|
|
11371
|
+
* to 2.78, only `FD_CLOEXEC` was supported. Support for `FD_CLOEXEC` may be
|
|
11372
|
+
* deprecated and removed in future.
|
|
11304
11373
|
* @param fds Array of two integers
|
|
11305
11374
|
* @param flags Bitfield of file descriptor flags, as for fcntl()
|
|
11306
11375
|
* @returns %TRUE on success, %FALSE if not (and errno will be set).
|
|
@@ -19135,13 +19204,13 @@ interface OptionEntry {
|
|
|
19135
19204
|
* called to handle the extra argument. Otherwise, `arg_data` is a
|
|
19136
19205
|
* pointer to a location to store the value, the required type of
|
|
19137
19206
|
* the location depends on the `arg` type:
|
|
19138
|
-
*
|
|
19139
|
-
*
|
|
19140
|
-
*
|
|
19141
|
-
*
|
|
19142
|
-
*
|
|
19143
|
-
*
|
|
19144
|
-
*
|
|
19207
|
+
* - %G_OPTION_ARG_NONE: %gboolean
|
|
19208
|
+
* - %G_OPTION_ARG_STRING: %gchar*
|
|
19209
|
+
* - %G_OPTION_ARG_INT: %gint
|
|
19210
|
+
* - %G_OPTION_ARG_FILENAME: %gchar*
|
|
19211
|
+
* - %G_OPTION_ARG_STRING_ARRAY: %gchar**
|
|
19212
|
+
* - %G_OPTION_ARG_FILENAME_ARRAY: %gchar**
|
|
19213
|
+
* - %G_OPTION_ARG_DOUBLE: %gdouble
|
|
19145
19214
|
* If `arg` type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME,
|
|
19146
19215
|
* the location will contain a newly allocated string if the option
|
|
19147
19216
|
* was given. That string needs to be freed by the callee using g_free().
|
|
@@ -19243,6 +19312,11 @@ class OptionGroup {
|
|
|
19243
19312
|
|
|
19244
19313
|
/**
|
|
19245
19314
|
* Creates a new #GOptionGroup.
|
|
19315
|
+
*
|
|
19316
|
+
* `description` is typically used to provide a title for the group. If so, it
|
|
19317
|
+
* is recommended that it’s written in title case, and has a trailing colon so
|
|
19318
|
+
* that it matches the style of built-in GLib group titles such as
|
|
19319
|
+
* ‘Application Options:’.
|
|
19246
19320
|
* @constructor
|
|
19247
19321
|
* @param name the name for the option group, this is used to provide help for the options in this group with `--help-``name`
|
|
19248
19322
|
* @param description a description for this group to be shown in `--help`. This string is translated using the translation domain or translation function of the group
|
|
@@ -19254,6 +19328,11 @@ class OptionGroup {
|
|
|
19254
19328
|
constructor(name: string | null, description: string | null, help_description: string | null, user_data: any | null, destroy: DestroyNotify | null)
|
|
19255
19329
|
/**
|
|
19256
19330
|
* Creates a new #GOptionGroup.
|
|
19331
|
+
*
|
|
19332
|
+
* `description` is typically used to provide a title for the group. If so, it
|
|
19333
|
+
* is recommended that it’s written in title case, and has a trailing colon so
|
|
19334
|
+
* that it matches the style of built-in GLib group titles such as
|
|
19335
|
+
* ‘Application Options:’.
|
|
19257
19336
|
* @constructor
|
|
19258
19337
|
* @param name the name for the option group, this is used to provide help for the options in this group with `--help-``name`
|
|
19259
19338
|
* @param description a description for this group to be shown in `--help`. This string is translated using the translation domain or translation function of the group
|
|
@@ -23483,9 +23562,9 @@ interface Tree {
|
|
|
23483
23562
|
* are O(log(n)).
|
|
23484
23563
|
* @param key the key to insert
|
|
23485
23564
|
* @param value the value corresponding to the key
|
|
23486
|
-
* @returns the inserted (or set) node.
|
|
23565
|
+
* @returns the inserted (or set) node or %NULL if insertion would overflow the tree node counter.
|
|
23487
23566
|
*/
|
|
23488
|
-
insert_node(key: any | null, value: any | null): TreeNode
|
|
23567
|
+
insert_node(key: any | null, value: any | null): TreeNode | null
|
|
23489
23568
|
/**
|
|
23490
23569
|
* Gets the value corresponding to the given key. Since a #GTree is
|
|
23491
23570
|
* automatically balanced as key/value pairs are added, key lookup
|
|
@@ -23524,7 +23603,7 @@ interface Tree {
|
|
|
23524
23603
|
lower_bound(key: any | null): TreeNode | null
|
|
23525
23604
|
/**
|
|
23526
23605
|
* Gets the number of nodes in a #GTree.
|
|
23527
|
-
* @returns the number of nodes in @tree
|
|
23606
|
+
* @returns the number of nodes in @tree The node counter value type is really a #guint, but it is returned as a #gint due to backward compatibility issues (can be cast back to #guint to support its full range of values).
|
|
23528
23607
|
*/
|
|
23529
23608
|
nnodes(): number
|
|
23530
23609
|
/**
|
|
@@ -23585,9 +23664,9 @@ interface Tree {
|
|
|
23585
23664
|
* so that the distance from the root to every leaf is as small as possible.
|
|
23586
23665
|
* @param key the key to insert
|
|
23587
23666
|
* @param value the value corresponding to the key
|
|
23588
|
-
* @returns the inserted (or set) node.
|
|
23667
|
+
* @returns the inserted (or set) node or %NULL if insertion would overflow the tree node counter.
|
|
23589
23668
|
*/
|
|
23590
|
-
replace_node(key: any | null, value: any | null): TreeNode
|
|
23669
|
+
replace_node(key: any | null, value: any | null): TreeNode | null
|
|
23591
23670
|
/**
|
|
23592
23671
|
* Removes a key and its associated value from a #GTree without calling
|
|
23593
23672
|
* the key and value destroy functions.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/glib-2.0",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.
|
|
3
|
+
"version": "2.78.0-3.2.5",
|
|
4
|
+
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.78.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "glib-2.0.js",
|
|
7
7
|
"main": "glib-2.0.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit glib-2.0.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gjs": "^3.2.
|
|
29
|
-
"@girs/gobject-2.0": "^2.
|
|
28
|
+
"@girs/gjs": "^3.2.5",
|
|
29
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"typescript": "*"
|