@girs/libxfce4util-1.0 1.0.0-4.0.0-beta.3

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 ADDED
@@ -0,0 +1,86 @@
1
+
2
+ # Libxfce4util-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/libxfce4util-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/libxfce4util-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for Libxfce4util-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
9
+
10
+
11
+ ## Install
12
+
13
+ To use this type definitions, install them with NPM:
14
+ ```bash
15
+ npm install @girs/libxfce4util-1.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import Libxfce4util from '@girs/libxfce4util-1.0';
23
+ ```
24
+
25
+ ### Ambient Modules
26
+
27
+ You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
28
+ For this you need to include `@girs/libxfce4util-1.0` or `@girs/libxfce4util-1.0/ambient` in your `tsconfig` or entry point Typescript file:
29
+
30
+ `index.ts`:
31
+ ```ts
32
+ import '@girs/libxfce4util-1.0'
33
+ ```
34
+
35
+ `tsconfig.json`:
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ ...
40
+ },
41
+ "include": ["@girs/libxfce4util-1.0"],
42
+ ...
43
+ }
44
+ ```
45
+
46
+ Now you can import the ambient module with TypeScript support:
47
+
48
+ ```ts
49
+ import Libxfce4util from 'gi://Libxfce4util?version=1.0';
50
+ ```
51
+
52
+ ### Global import
53
+
54
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
55
+ For this you need to include `@girs/libxfce4util-1.0` or `@girs/libxfce4util-1.0/import` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '@girs/libxfce4util-1.0'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["@girs/libxfce4util-1.0"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you have also type support for this, too:
74
+
75
+ ```ts
76
+ const Libxfce4util = imports.gi.Libxfce4util;
77
+ ```
78
+
79
+ ### Bundle
80
+
81
+ 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).
82
+
83
+ ## Other packages
84
+
85
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
86
+
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://Libxfce4util?version=1.0' {
3
+ import Libxfce4util from '@girs/libxfce4util-1.0';
4
+ export default Libxfce4util;
5
+ }
6
+
7
+ declare module 'gi://Libxfce4util' {
8
+ import Libxfce4util10 from 'gi://Libxfce4util?version=1.0';
9
+ export default Libxfce4util10;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,12 @@
1
+
2
+ import Libxfce4util10 from '@girs/libxfce4util-1.0';
3
+
4
+ declare global {
5
+ export interface GjsGiImports {
6
+ Libxfce4util: typeof Libxfce4util10;
7
+ }
8
+ }
9
+
10
+ export default GjsGiImports;
11
+
12
+
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,778 @@
1
+ /*
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ */
7
+
8
+ import './libxfce4util-1.0-ambient.d.ts';
9
+
10
+ /**
11
+ * Libxfce4util-1.0
12
+ */
13
+
14
+ import type Gio from '@girs/gio-2.0';
15
+ import type GObject from '@girs/gobject-2.0';
16
+ import type GLib from '@girs/glib-2.0';
17
+
18
+ export namespace Libxfce4util {
19
+ /**
20
+ * The license text to return from xfce_get_license_text().
21
+ */
22
+ enum LicenseTextType {
23
+ /**
24
+ * the BSD License.
25
+ */
26
+ BSD,
27
+ /**
28
+ * the GNU General Public License.
29
+ */
30
+ GPL,
31
+ /**
32
+ * the GNU Lesser General Public License.
33
+ */
34
+ LGPL,
35
+ }
36
+ enum ResourceType {
37
+ /**
38
+ * where applications store data.
39
+ */
40
+ DATA,
41
+ /**
42
+ * configuration files.
43
+ */
44
+ CONFIG,
45
+ /**
46
+ * cached information.
47
+ */
48
+ CACHE,
49
+ /**
50
+ * icon search path.
51
+ */
52
+ ICONS,
53
+ /**
54
+ * themes search path.
55
+ */
56
+ THEMES,
57
+ }
58
+ const LOCALE_FULL_MATCH: number;
59
+ const LOCALE_NO_MATCH: number;
60
+ /**
61
+ * An alias of xfce_g_string_append_quoted().
62
+ * @param string A #GString.
63
+ * @param unquoted A literal string.
64
+ */
65
+ function append_quoted(string: GLib.String, unquoted: string): void;
66
+ /**
67
+ * Creates the shared thumbnail path for the file that corresponds to the given `uri`
68
+ * and `size`. No checks are made regarding the existence of the thumbnail.
69
+ *
70
+ * It is the duty of the caller to free the returned string.
71
+ * @param uri the uri of the file whose shared thumbnail we want to find.
72
+ * @param size the thumbnail size (e.g. normal, large).
73
+ * @returns a string with the thumbnail path or NULL if the @uri could not be converted to a local filename.
74
+ */
75
+ function create_shared_thumbnail_path(uri: string, size: string): string;
76
+ /**
77
+ * Expands field codes in `command` according to Freedesktop.org Desktop Entry Specification.
78
+ * @param command Input string (command to expand) or %NULL.
79
+ * @param uri_list Input string list (filename/URL field) or %NULL.
80
+ * @param icon Input string (icon field) or %NULL.
81
+ * @param name Input string (name field) or %NULL.
82
+ * @param uri Input string (URI field) or %NULL.
83
+ * @param requires_terminal Input boolean.
84
+ * @returns %NULL on error, else the string, which should be freed using g_free() when no longer needed.
85
+ */
86
+ function expand_desktop_entry_field_codes(
87
+ command: string,
88
+ uri_list: string[],
89
+ icon: string,
90
+ name: string,
91
+ uri: string,
92
+ requires_terminal: boolean,
93
+ ): string;
94
+ /**
95
+ * Expands shell like environment variables and tilde (~/ and ~user/ are both supported)
96
+ * in `command`.
97
+ * @param command Input string or %NULL.
98
+ * @param envp Addition environment variables to take into account. These variables have higher priority than the ones in the process's environment.
99
+ * @returns %NULL on error, else the string, which should be freed using g_free() when no longer needed.
100
+ */
101
+ function expand_variables(command: string, envp: string): string;
102
+ /**
103
+ * Generates an SHA-256 hash of the `file`.
104
+ * @param file a #GFile.
105
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
106
+ * @returns Checksum of the @file. If file read fails, returns %NULL. Free with g_free().
107
+ */
108
+ function g_file_create_checksum(file: Gio.File, cancellable?: Gio.Cancellable | null): string | null;
109
+ /**
110
+ * Compares the checksum stored in safety flag
111
+ * with the actual file. If it matches, it
112
+ * is considered safe.
113
+ *
114
+ * Read the documentation of
115
+ * xfce_g_file_set_trusted() for details.
116
+ * @param file a #GFile.
117
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
118
+ * @returns %TRUE if safety flag is verified or not supported. %FALSE otherwise.
119
+ */
120
+ function g_file_is_trusted(file: Gio.File, cancellable?: Gio.Cancellable | null): boolean;
121
+ /**
122
+ * Checks if GVFS-metadata is available for
123
+ * the `file` provided.
124
+ * @param file a #GFile.
125
+ * @returns %TRUE is GVFS-metadata is supported, %FALSE otherwise.
126
+ */
127
+ function g_file_metadata_is_supported(file: Gio.File): boolean;
128
+ /**
129
+ * Sets the "safety flag" on if `is_trusted`.
130
+ *
131
+ * Safety flag is a new concept introduced in
132
+ * XFCE 4.17. It is basically an additional
133
+ * execution flag stored in GVFS-metadata.
134
+ * Unlike the execution flag (+x), it is safe
135
+ * to assume that this flag did not come from
136
+ * foreign location (for example, by downloading
137
+ * an tar archive) and is set by user.
138
+ *
139
+ * The checksum of the file is stored, and
140
+ * would be considered "on" only if checksum
141
+ * matches with the file on execution.
142
+ * @param file a #GFile.
143
+ * @param is_trusted #TRUE if trusted, #FALSE if not
144
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
145
+ * @returns %TRUE on success, %FALSE on error.
146
+ */
147
+ function g_file_set_trusted(file: Gio.File, is_trusted: boolean, cancellable?: Gio.Cancellable | null): boolean;
148
+ /**
149
+ * Quotes a string `unquoted` and appends to an existing
150
+ * #GString `string`. The shell will interpret the quoted string
151
+ * to mean `unquoted`. The quoting style used is undefined
152
+ * (check g_shell_quote ()).
153
+ * @param string A #GString.
154
+ * @param unquoted A literal string.
155
+ */
156
+ function g_string_append_quoted(string: GLib.String, unquoted: string): void;
157
+ /**
158
+ * Similar to xfce_get_file_localized(), but works on directory instead of
159
+ * a file.
160
+ * @param directory directory name to check for a localized variant.
161
+ * @returns path of the localized directory name or copy of @directory if no such directory exists. Returned string should be freed using g_free().
162
+ */
163
+ function get_dir_localized(directory: string): string;
164
+ /**
165
+ * Similar to #xfce_get_file_localized_r, but works on directory instead
166
+ * of regular file.
167
+ * @param buffer destination buffer to store the localized filename to.
168
+ * @param length size of @buffer in bytes.
169
+ * @param directory name of directory to check for localized variant of.
170
+ * @returns pointer to @buffer or %NULL on error.
171
+ */
172
+ function get_dir_localized_r(buffer: string, length: number, directory: string): string;
173
+ /**
174
+ * Checks if theres a version of `filename` which is localized to the current
175
+ * locale. This is done by appending the full locale name to `filename,` separated
176
+ * by a '.'. If theres no file of that name, it retries using the full locale
177
+ * name without the encoding (if any), then without the qualifier (if any) and
178
+ * at last the base locale is tried. If all of those fails, a copy of `filename`
179
+ * is returned.
180
+ * @param filename name of a file to look for a localized version.
181
+ * @returns path of the localized file or copy of @filename if no such file exists. Returned string should be freed using g_free().
182
+ */
183
+ function get_file_localized(filename: string): string;
184
+ /**
185
+ * Similar in functionality to xfce_get_file_localized(), but stores the
186
+ * result in `buffer` instead of allocating a new buffer.
187
+ * @param buffer destination buffer to store the localized filename to.
188
+ * @param length size of @buffer in bytes.
189
+ * @param filename name of a file to look for a localized version.
190
+ * @returns pointer to @buffer or %NULL on error.
191
+ */
192
+ function get_file_localized_r(buffer: string, length: number, filename: string): string;
193
+ /**
194
+ * Similar to g_get_home_dir() in functionality but will never return NULL.
195
+ * While g_get_home_dir() may return NULL under certain circumstances, this
196
+ * function is garantied to never ever return NULL, but always return a
197
+ * valid character pointer with the absolute path to the user's home directory.
198
+ *
199
+ * The returned string is owned by libxfce4util and must not be freed by
200
+ * the caller.
201
+ * @returns the path to the current user's home directory.
202
+ */
203
+ function get_homedir(): string;
204
+ /**
205
+ * Returns the text of the software license specified in the
206
+ * `license_type` translated to the current language. If no
207
+ * translation is available, the english license text will
208
+ * be returned.
209
+ * @param license_type an #XfceLicenseTextType.
210
+ * @returns the license text for @license_type.
211
+ */
212
+ function get_license_text(license_type: LicenseTextType): string;
213
+ /**
214
+ * `paths` is a ':'-separated list of pathnames, with:
215
+ *
216
+ * - `%F`: the `filename`
217
+ * - `%L`: the language string, as returned by `setlocale(LC_MESSAGES, NULL)`
218
+ * - `%l`: the language component of the language string
219
+ * - `%N`: application name
220
+ *
221
+ * Example paths: `/usr/local/lib/%L/%F:/usr/local/share/%N/%l/%F`
222
+ * @param dst destination buffer.
223
+ * @param size size of @dst in bytes.
224
+ * @param paths the path
225
+ * @param filename the filename
226
+ * @param test test
227
+ */
228
+ function get_path_localized(
229
+ dst: string,
230
+ size: number,
231
+ paths: string,
232
+ filename: string,
233
+ test: GLib.FileTest,
234
+ ): string;
235
+ /**
236
+ * Safe way to retrieve the path to the user's ".xfce4" directory. The path
237
+ * to the current user's ".xfce4" directory is either taken from the
238
+ * environment variable XFCE4HOME if defined, or if unset, is gained by
239
+ * concatenating the path to the user's home directory and the ".xfce4".
240
+ * That says, it will, by default, return the path "$HOME/.xfce4", where
241
+ * $HOME is replaced with the absolute path to the user's home directory.
242
+ *
243
+ * The returned string is managed by libxfce4util and must not be freed by
244
+ * the caller.
245
+ * @returns the path to the current user's ".xfce4" directory.
246
+ */
247
+ function get_userdir(): string;
248
+ /**
249
+ * Portable way to query the hostname of the node running the process. This
250
+ * function does not ever return %NULL, but always returns a string containing
251
+ * the current node's hostname.
252
+ * @returns the current node's hostname. The string has to be freed by the caller using g_free().
253
+ */
254
+ function gethostname(): string;
255
+ /**
256
+ * The locale is of the general form LANG_COUNTRY.ENCODING @ MODIFIER, where
257
+ * each of COUNTRY, ENCODING and MODIFIER can be absent.
258
+ *
259
+ * The match is done by actually removing the rightmost element one by one. This
260
+ * is not entirely according to the freedesktop.org specification, but much easier.
261
+ * Will probably be fixed in the future.
262
+ * @param locale1 the current locale value as returned by setlocale(LC_MESSAGES,%NULL).
263
+ * @param locale2 the locale value to match against.
264
+ * @returns an integer value indicating the level of matching, where the constant #XFCE_LOCALE_FULL_MATCH indicates a full match and #XFCE_LOCALE_NO_MATCH means no match. Every other value indicates a partial match, the higher the value, the better the match. You should not rely on any specific value besides the constants #XFCE_LOCALE_FULL_MATCH and #XFCE_LOCALE_NO_MATCH, since the range of returned values may change in the future.
265
+ */
266
+ function locale_match(locale1: string, locale2: string): number;
267
+ /**
268
+ * Creates the specified directory `whole_path,` but unlike the mkdir()
269
+ * function from the standard C library, if any of the parent directories
270
+ * of the `whole_path` do not exists, they are created as well.
271
+ *
272
+ * If the directory specified by `whole_path` already exists, this function
273
+ * performs no operation and simply returns %TRUE.
274
+ * @param whole_path path to the directory to create.
275
+ * @param mode file permissions to use for the newly created directories.
276
+ * @returns %TRUE on success, else %FALSE.
277
+ */
278
+ function mkdirhier(whole_path: string, mode: number): boolean;
279
+ /**
280
+ * Initializes the POSIX signal handler system. Must be called
281
+ * before setting any POSIX signal handlers.
282
+ * @returns %TRUE on success, %FALSE on failure, in which case @error will be set.
283
+ */
284
+ function posix_signal_handler_init(): boolean;
285
+ /**
286
+ * Restores the default handler for `signal`.
287
+ * @param signal A POSIX signal id number.
288
+ */
289
+ function posix_signal_handler_restore_handler(signal: number): void;
290
+ /**
291
+ * Sets `handler` to be called whenever `signal` is caught by the
292
+ * application. The `user_data` parameter will be passed as an argument
293
+ * to `handler`.
294
+ * @param signal A POSIX signal id number.
295
+ * @param handler A callback function.
296
+ * @returns %TRUE on success, %FALSE otherwise, in which case @error will be set.
297
+ */
298
+ function posix_signal_handler_set_handler(signal: number, handler: PosixSignalHandler): boolean;
299
+ /**
300
+ * Frees all memory associated with the POSIX signal handling system
301
+ * and restores all default signal handlers.
302
+ */
303
+ function posix_signal_handler_shutdown(): void;
304
+ /**
305
+ * If `readonly` is %TRUE parsing is generally faster, because only untranslated
306
+ * entries and entries that match the current locale will be loaded. Also if
307
+ * you pass %TRUE for `readonly,` #xfce_rc_config will fail if `resource`
308
+ * does not reference a regular file.
309
+ *
310
+ * It is no error if `readonly` is %FALSE and the file referenced by `resource`
311
+ * does not exists. In this case you'll start with a fresh config, which contains
312
+ * only the default group and no entries.
313
+ * @param type The resource type being opened
314
+ * @param resource The resource name to open
315
+ * @param readonly whether to open @resource readonly.
316
+ * @returns the newly created #XfceRc object, or %NULL on error.
317
+ */
318
+ function rc_config_open(type: ResourceType, resource: string, readonly: boolean): Rc;
319
+ /**
320
+ * Parses the resource config file specified by `filename`.
321
+ *
322
+ * If `readonly` is %TRUE parsing is generally faster, because only untranslated
323
+ * entries and entries that match the current locale will be loaded. Also if
324
+ * you pass %TRUE for `readonly,` #xfce_rc_simple_open will fail if `filename`
325
+ * does not reference a regular file.
326
+ *
327
+ * It is no error if `readonly` is %FALSE and the file referenced by `filename`
328
+ * does not exists. In this case you'll start with a fresh config, which contains
329
+ * only the default group and no entries.
330
+ * @param filename name of the filename to open.
331
+ * @param readonly whether to open @filename readonly.
332
+ * @returns the newly created #XfceRc object, or %NULL on error.
333
+ */
334
+ function rc_simple_open(filename: string, readonly: boolean): Rc;
335
+ /**
336
+ * Queries the list of possible directories for the specified `type`. The
337
+ * first element of the list is always the save location for `type`. None
338
+ * of the directories returned in the list are garantied to exist.
339
+ *
340
+ * This function should be rarely used. You should consider using
341
+ * xfce_resource_lookup() or xfce_resource_match() instead.
342
+ *
343
+ * The returned list must be freed using g_strfreev().
344
+ * @param type type of the resource.
345
+ * @returns list of possible directories for @type.
346
+ */
347
+ function resource_dirs(type: ResourceType): string[];
348
+ /**
349
+ * Looks for a resource of the specified `type` whose relative path matches
350
+ * `filename`. `filename` can either reference a regular file, in which case
351
+ * it must not end with a slash character ('/'), or a directory, when
352
+ * `filename` contains a trailing slash character ('/').
353
+ *
354
+ * The caller is responsible to free the returned string using g_free()
355
+ * when no longer needed.
356
+ * @param type type of resource to lookup.
357
+ * @param filename relative filename of the resource, e.g. "xfwm4/xfwmrc".
358
+ * @returns the absolute path to the first file or directory in the search path, that matches @filename or %NULL if no such file or directory could be found.
359
+ */
360
+ function resource_lookup(type: ResourceType, filename: string): string;
361
+ /**
362
+ * Similar to xfce_resource_lookup(), but returns all resource of the specified `type,`
363
+ * that whose name is `filename`.
364
+ *
365
+ * The caller is responsible to free the returned string array using g_strfreev()
366
+ * when no longer needed.
367
+ * @param type type of the resource to lookup.
368
+ * @param filename relative file path. If @filename contains a trailing slash character it is taken to reference a directory, else it is taken to reference a file.
369
+ * @returns list of possible resources for @type.
370
+ */
371
+ function resource_lookup_all(type: ResourceType, filename: string): string[];
372
+ /**
373
+ * Tries to find all resources with the specified `type`. The function will
374
+ * look into all specified directories and return all filenames in these
375
+ * directories. The returned filenames are given relative the base directories
376
+ * specified by `type`.
377
+ *
378
+ * If `pattern` contains a trailing slash, #xfce_resource_match looks only for
379
+ * directories that match `pattern,` else it'll only look for regular files. In
380
+ * case you are looking for directories, the returned entries will contain a
381
+ * trailing slash as well, so you can easily use them with other resource
382
+ * functions like #xfce_resource_lookup or #xfce_resource_save_location.
383
+ *
384
+ * Example: xfce_resource_match (XFCE_RESOURCE_CONFIG, "foo/bar*") will probably
385
+ * return ("foo/bar", "foo/barbaz", ...).
386
+ * @param type type of the resource to locate directories for.
387
+ * @param pattern only accept filenames that fit to the pattern. The pattern needs to be a valid GPattern.
388
+ * @param unique if %TRUE, only return items which have unique suffixes.
389
+ * @returns string array of all the relative paths whose names matches the given @pattern. The return value has to be freed using g_strfreev() when no longer needed.
390
+ */
391
+ function resource_match(type: ResourceType, pattern: string, unique: boolean): string[];
392
+ /**
393
+ * Yet to be implemented!
394
+ * @param type type of the resource to locate directories for.
395
+ * @param unique if %TRUE, only return items which have unique suffixes.
396
+ * @param func callback to determine if there was a match
397
+ * @returns The caller is responsible to free the returned string array using g_strfreev() when no longer needed.
398
+ */
399
+ function resource_match_custom(type: ResourceType, unique: boolean, func: MatchFunc): string[];
400
+ /**
401
+ * Undoes the effect of the latest call to xfce_resource_push_path(). You
402
+ * should take special care to call xfce_resource_pop_path() exactly same
403
+ * times as xfce_resource_push_path(), everything else might result in
404
+ * unwanted and maybe even undefined behaviour. You have been warned!
405
+ * @param type type of the resource which search list should be shrinked.
406
+ */
407
+ function resource_pop_path(type: ResourceType): void;
408
+ /**
409
+ * Appends `path` to the search path list for `type`. This function was
410
+ * written primary for use within modules in larger applications, for example
411
+ * MCS plugins.
412
+ *
413
+ * For example, if you need to add a specific path to the search path list
414
+ * in your MCS, you should call xfce_resource_push_path() prior to calling
415
+ * one of the resource search functions and call xfce_resource_pop_path()
416
+ * right afterwards.
417
+ * @param type type of the resource which search list should be expanded.
418
+ * @param path search path to add.
419
+ */
420
+ function resource_push_path(type: ResourceType, path: string): void;
421
+ /**
422
+ * If `relpath` contains a trailing slash ('/') character, xfce_resource_save_location()
423
+ * finds the directory to save files into for the given type in the user's
424
+ * home directory. All directories needed (including those given by
425
+ * `relpath)` will be created on demand if `create` if %TRUE.
426
+ *
427
+ * If `relpath` does not end with a slash ('/') character, it is taken to be
428
+ * the name of a file to return the save location for. All the directories
429
+ * needed will be created on demand if `create` is %TRUE.
430
+ *
431
+ * Specifying %NULL or the empty string for `relpath` allows you to discover
432
+ * the base path for saving files of the specified `type,` though normally
433
+ * you should not need this.
434
+ * @param type type of location to return.
435
+ * @param relpath relative path of the resource.
436
+ * @param create whether to create missing directory.
437
+ * @returns the path where resources of the specified @type should be saved or %NULL on error. The returned string should be freed when no longer needed.
438
+ */
439
+ function resource_save_location(type: ResourceType, relpath: string, create: boolean): string;
440
+ /**
441
+ * Searches `str` for occurances of `pattern` and replaces each
442
+ * such occurance with `replacement`. Returns a newly allocated
443
+ * copy of `str` on which the given replacement were performed.
444
+ * The caller is responsible to free the returned string using
445
+ * g_free() when no longer needed.
446
+ *
447
+ * Note that `pattern` and `replacement` don't need to be of the
448
+ * same size. If `replacement` is %NULL, the pattern will be
449
+ * removed from the string.
450
+ *
451
+ * Note for future Xfce developers: Deprecate this function when
452
+ * g_string_replace() is available. (Added since Glib >= 2.68)
453
+ * @param str the input string.
454
+ * @param pattern a search pattern in @str.
455
+ * @param replacement replacement string for @pattern.
456
+ * @returns a newly allocated copy of @str where all occurrences of @pattern are replaced with @replacement. Or %NULL if @str is %NULL.
457
+ */
458
+ function str_replace(str: string, pattern: string, replacement: string): string | null;
459
+ /**
460
+ * Sets up the translations for `package`.
461
+ * @param _package the package name.
462
+ * @param localedir the @package<!---->s locale directory.
463
+ * @param encoding the encoding to use the @package<!---->s translations or %NULL to use "UTF-8".
464
+ */
465
+ function textdomain(_package: string, localedir: string, encoding: string): void;
466
+ /**
467
+ * Unescapes sequences in `value` according to Freedesktop.org Desktop Entry Specification.
468
+ * @param value Value string to replace escape sequences.
469
+ * @returns %NULL on error, else the string, which should be freed using g_free() when no longer needed.
470
+ */
471
+ function unescape_desktop_entry_value(value: string): string;
472
+ /**
473
+ * Removes all control characters from `str` up to `end` or up to
474
+ * `max_len` characters (note that characters does not mean bytes with
475
+ * UTF-8), where both `str` and `max_len` may not be given.
476
+ *
477
+ * Control characters are replaced in `str` by whitespaces, no new string
478
+ * will be allocated. The operation is done in-place.
479
+ * @param str target string.
480
+ * @param max_len max characters to check or -1 for no character limit.
481
+ * @param end pointer to the endpoint in @str or %NULL for no endpoint.
482
+ * @returns pointer to @str or %NULL on error.
483
+ */
484
+ function utf8_remove_controls(str: string, max_len: number, end: string): string;
485
+ /**
486
+ * Duplicates the `src` string up to `max_len` characters
487
+ * (note that characters does not mean bytes with UTF-8).
488
+ *
489
+ * The caller is responsible to free the returned string
490
+ * using g_free() when no longer needed.
491
+ * @param src target string.
492
+ * @param max_len max characters to duplicate or -1 for no character limit.
493
+ * @returns pointer to the newly allocated string.
494
+ */
495
+ function utf8_strndup(src: string, max_len: number): string;
496
+ /**
497
+ * Queries the version string of the installed Xfce desktop environment.
498
+ * @returns the overall version information of the installed Xfce desktop.
499
+ */
500
+ function version_string(): string;
501
+ interface MatchFunc {
502
+ (basedir: string, relpath: string): boolean;
503
+ }
504
+ interface PosixSignalHandler {
505
+ (signal: number): void;
506
+ }
507
+ module Kiosk {
508
+ // Constructor properties interface
509
+
510
+ interface ConstructorProps extends GObject.Object.ConstructorProps {}
511
+ }
512
+
513
+ class Kiosk extends GObject.Object {
514
+ static $gtype: GObject.GType<Kiosk>;
515
+
516
+ // Constructors of Libxfce4util.Kiosk
517
+
518
+ constructor(properties?: Partial<Kiosk.ConstructorProps>, ...args: any[]);
519
+
520
+ _init(...args: any[]): void;
521
+
522
+ static ['new'](module: string): Kiosk;
523
+
524
+ // Own methods of Libxfce4util.Kiosk
525
+
526
+ /**
527
+ * Frees the `kiosk` object.
528
+ * In 4.13 and above, this is equivalent to calling g_clear_object.
529
+ */
530
+ free(): void;
531
+ /**
532
+ * Queries the `kiosk` object for a given capability and returns %TRUE if
533
+ * the current user has the `capability,` else %FALSE.
534
+ * @param capability The name of the capability to check.
535
+ * @returns %TRUE if the current user has the @capability, else %FALSE.
536
+ */
537
+ query(capability: string): boolean;
538
+ }
539
+
540
+ type KioskClass = typeof Kiosk;
541
+ abstract class Rc {
542
+ static $gtype: GObject.GType<Rc>;
543
+
544
+ // Constructors of Libxfce4util.Rc
545
+
546
+ _init(...args: any[]): void;
547
+
548
+ // Own static methods of Libxfce4util.Rc
549
+
550
+ /**
551
+ * If `readonly` is %TRUE parsing is generally faster, because only untranslated
552
+ * entries and entries that match the current locale will be loaded. Also if
553
+ * you pass %TRUE for `readonly,` #xfce_rc_config will fail if `resource`
554
+ * does not reference a regular file.
555
+ *
556
+ * It is no error if `readonly` is %FALSE and the file referenced by `resource`
557
+ * does not exists. In this case you'll start with a fresh config, which contains
558
+ * only the default group and no entries.
559
+ * @param type The resource type being opened
560
+ * @param resource The resource name to open
561
+ * @param readonly whether to open @resource readonly.
562
+ */
563
+ static config_open(type: ResourceType, resource: string, readonly: boolean): Rc;
564
+ /**
565
+ * Parses the resource config file specified by `filename`.
566
+ *
567
+ * If `readonly` is %TRUE parsing is generally faster, because only untranslated
568
+ * entries and entries that match the current locale will be loaded. Also if
569
+ * you pass %TRUE for `readonly,` #xfce_rc_simple_open will fail if `filename`
570
+ * does not reference a regular file.
571
+ *
572
+ * It is no error if `readonly` is %FALSE and the file referenced by `filename`
573
+ * does not exists. In this case you'll start with a fresh config, which contains
574
+ * only the default group and no entries.
575
+ * @param filename name of the filename to open.
576
+ * @param readonly whether to open @filename readonly.
577
+ */
578
+ static simple_open(filename: string, readonly: boolean): Rc;
579
+
580
+ // Own methods of Libxfce4util.Rc
581
+
582
+ /**
583
+ * Destructs `rc`.
584
+ *
585
+ * If `rc` was opened read-write and contains dirty (modified) entries, these
586
+ * will be flushed to permanent storage first.
587
+ */
588
+ close(): void;
589
+ /**
590
+ * Similar to #xfce_rc_delete_group, but works on an entry in the current
591
+ * group.
592
+ * @param key the key to delete.
593
+ * @param global whether to delete @key globally.
594
+ */
595
+ delete_entry(key: string, global: boolean): void;
596
+ /**
597
+ * If `rc` is a simple config object and `group` exists, it is deleted. All entries
598
+ * within `group` will be deleted. For simple config objects, `global` is ignored.
599
+ *
600
+ * If `rc` is a complex config object and `group` exists, it will be deleted will
601
+ * all entries. If `global` is %TRUE, the entry will be marked as deleted globally,
602
+ * therefore all calls to #xfce_rc_read_entry and related functions will return
603
+ * the fallback values. If `global` is %FALSE, the `group` will be deleted in the
604
+ * per-user config file, and further calls to #xfce_rc_read_entry will most
605
+ * probably return the system-wide config entries.
606
+ * @param group name of the group to delete.
607
+ * @param global whether to delete the group globally.
608
+ */
609
+ delete_group(group: string, global: boolean): void;
610
+ /**
611
+ * Flushes all changes that currently reside only in memory back to permanent
612
+ * storage. Dirty configuration entries are written in the most specific file
613
+ * available.
614
+ */
615
+ flush(): void;
616
+ /**
617
+ * Returns the names of all entries in `group` if any.
618
+ *
619
+ * %NULL is a valid input value for `group`. #xfce_rc_get_entries will
620
+ * then return all entries in the so called "NULL group". Though this
621
+ * "NULL group" should only be used for backward compatibility with old
622
+ * applications. You should not use it in newly written code.
623
+ * @param group the name of the group to get entries from.
624
+ * @returns a NULL-terminated string array with all entries in @group. Has to be freed using g_strfreev() if no longer needed. If the specified @group does not exists, %NULL is returned. If the @group has no entries, an empty string array is returned.
625
+ */
626
+ get_entries(group: string): string[];
627
+ /**
628
+ * Returns the name of the group in which we are searching for keys and
629
+ * from which we are retrieving entries. If the currently active group is
630
+ * the default group (the so called "NULL group"), %NULL will be returned.
631
+ * @returns the name of the current group.
632
+ */
633
+ get_group(): string;
634
+ /**
635
+ * Returns the names of all known groups in `rc`.
636
+ *
637
+ * Since the default groups (the "NULL group") name is %NULL, it will not be
638
+ * returned with this functions. But it does not matter at all, since the
639
+ * default group is known to always exist.
640
+ * @returns a NULL-terminated string array will the names of all groups in @rc. Should be freed using g_strfreev() when no longer needed.
641
+ */
642
+ get_groups(): string[];
643
+ /**
644
+ * Returns current locale used by `rc` to lookup translated entries.
645
+ * @returns a string representing the current locale.
646
+ */
647
+ get_locale(): string;
648
+ /**
649
+ * Checks whether the `key` has an entry in the current group.
650
+ * @param key the key to search for.
651
+ * @returns %TRUE if the @key is available, else %FALSE.
652
+ */
653
+ has_entry(key: string): boolean;
654
+ /**
655
+ * Returns %TRUE if the specified `group` is known about.
656
+ * @param group the group to search for.
657
+ * @returns %TRUE if the @group exists.
658
+ */
659
+ has_group(group: string): boolean;
660
+ /**
661
+ * Checks whether `rc` has any dirty (modified) entries.
662
+ * @returns %TRUE if @rc has any dirty (modified) entries.
663
+ */
664
+ is_dirty(): boolean;
665
+ /**
666
+ * Returns the read-only status of `rc`.
667
+ * @returns the read-only status.
668
+ */
669
+ is_readonly(): boolean;
670
+ /**
671
+ * Reads the value of an entry specified by `key` in the current group and interpret
672
+ * it as a boolean value. Currently "on", "true" and "yes" are accepted as true,
673
+ * everything else is false.
674
+ * @param key the key to search for.
675
+ * @param fallback a default value returned if the @key was not found.
676
+ * @returns the value for this @key.
677
+ */
678
+ read_bool_entry(key: string, fallback: boolean): boolean;
679
+ /**
680
+ * Reads the value of an entry specified by `key` in the current group.
681
+ * @param key the key to search for.
682
+ * @param fallback a default value returned if the @key was not found.
683
+ * @returns the value for this @key, or @fallback if @key was not found.
684
+ */
685
+ read_entry(key: string, fallback: string): string;
686
+ /**
687
+ * Reads the value of an entry specified by `key` in the current group. The
688
+ * untranslated entry is returned. You normally do not need this.
689
+ * @param key the key to search for.
690
+ * @param fallback a default value returned if the @key was not found.
691
+ * @returns the untranslated value for this @key, or @fallback if @key was not found.
692
+ */
693
+ read_entry_untranslated(key: string, fallback: string): string;
694
+ /**
695
+ * Reads the value of an entry specified by `key` in the current group
696
+ * and interprets it as an integer value.
697
+ * @param key the key to search for.
698
+ * @param fallback a default value returned if the @key was not found.
699
+ * @returns the value for this @key.
700
+ */
701
+ read_int_entry(key: string, fallback: number): number;
702
+ /**
703
+ * Reads a list of strings in the entry specified by key in the current group.
704
+ * The returned list has to be freed using g_strfreev() when no longer needed.
705
+ *
706
+ * This does not support delimiter escaping. If you need this feature, use
707
+ * g_key_file_get_string_list() instead.
708
+ * @param key the key to search for.
709
+ * @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. If NULL, "," is used.
710
+ * @returns the list or NULL if the entry does not exist.
711
+ */
712
+ read_list_entry(key: string, delimiter: string): string[];
713
+ /**
714
+ * Mark `rc` as "clean", i.e. don't write dirty entries at destruction time. If
715
+ * you then call #xfce_rc_write_entry again, the dirty flag is set again and
716
+ * dirty entries will be written at a subsequent #xfce_rc_flush call.
717
+ */
718
+ rollback(): void;
719
+ /**
720
+ * Specifies the group in which keys will be read and written. Subsequent calls
721
+ * to #xfce_rc_read_entry and #xfce_rc_write_entry will be applied only in the
722
+ * active group.
723
+ *
724
+ * If `group` references a group that does not exists, it will be created for
725
+ * you. But note, that empty groups will not be synced to permanent storage.
726
+ * @param group the name of the new group or %NULL to to switch back to the default group.
727
+ */
728
+ set_group(group: string): void;
729
+ /**
730
+ * Wrapper for #xfce_rc_write_entry, that stores a boolean `value`.
731
+ * @param key the key to write.
732
+ * @param value the value to write.
733
+ */
734
+ write_bool_entry(key: string, value: boolean): void;
735
+ /**
736
+ * Writes a `key/``value` pair. This has no effect if the resource config
737
+ * was opened readonly, else the value will be written to permanent storage
738
+ * on the next call to #xfce_rc_flush or when `rc` is destroyed using
739
+ * #xfce_rc_close.
740
+ *
741
+ * If `rc` was opened using #xfce_rc_config_open, the value will be
742
+ * written to the most specific config file.
743
+ * @param key the key to write.
744
+ * @param value the value to write.
745
+ */
746
+ write_entry(key: string, value: string): void;
747
+ /**
748
+ * Wrapper for #xfce_rc_write_entry, that stores an integer `value`.
749
+ * @param key the key to write.
750
+ * @param value the value to write.
751
+ */
752
+ write_int_entry(key: string, value: number): void;
753
+ /**
754
+ * Wrapper for #xfce_rc_write_entry, that stores a string list `value`.
755
+ *
756
+ * This does not support delimiter escaping. If you need this feature, use
757
+ * g_key_file_set_string_list() instead.
758
+ * @param key the key to write.
759
+ * @param value a %NULL terminated list of strings to store in the entry specified by key.
760
+ * @param separator the list separator. Defaults to "," if %NULL.
761
+ */
762
+ write_list_entry(key: string, value: string, separator: string): void;
763
+ }
764
+
765
+ /**
766
+ * Name of the imported GIR library
767
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
768
+ */
769
+ const __name__: string;
770
+ /**
771
+ * Version of the imported GIR library
772
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
773
+ */
774
+ const __version__: string;
775
+ }
776
+
777
+ export default Libxfce4util;
778
+ // END
@@ -0,0 +1,6 @@
1
+
2
+ // @ts-expect-error
3
+ import Libxfce4util from 'gi://Libxfce4util?version=1.0';
4
+ export { Libxfce4util };
5
+ export default Libxfce4util;
6
+
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@girs/libxfce4util-1.0",
3
+ "version": "1.0.0-4.0.0-beta.3",
4
+ "description": "GJS TypeScript type definitions for Libxfce4util-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "libxfce4util-1.0.js",
7
+ "main": "libxfce4util-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./libxfce4util-1.0-ambient.d.ts",
11
+ "import": "./libxfce4util-1.0-ambient.js",
12
+ "default": "./libxfce4util-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./libxfce4util-1.0-import.d.ts",
16
+ "import": "./libxfce4util-1.0-import.js",
17
+ "default": "./libxfce4util-1.0-import.js"
18
+ },
19
+ ".": {
20
+ "types": "./libxfce4util-1.0.d.ts",
21
+ "import": "./libxfce4util-1.0.js",
22
+ "default": "./libxfce4util-1.0.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit libxfce4util-1.0.d.ts"
27
+ },
28
+ "dependencies": {
29
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
30
+ "@girs/gjs": "^4.0.0-beta.3",
31
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
32
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
33
+ },
34
+ "devDependencies": {
35
+ "typescript": "*"
36
+ },
37
+ "keywords": [
38
+ "Gir",
39
+ "TypeScript",
40
+ "types",
41
+ "GObject-Introspection",
42
+ "GJS",
43
+ "Libxfce4util-1.0"
44
+ ],
45
+ "author": "ts-for-gir",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
53
+ },
54
+ "homepage": "https://github.com/gjsify/types/tree/main/libxfce4util-1.0#readme"
55
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "node",
10
+ "noEmit": true,
11
+ "noEmitOnError": false,
12
+ "baseUrl": "./",
13
+ "rootDir": ".",
14
+ // General settings for code generation
15
+ "removeComments": false,
16
+ "inlineSourceMap": false,
17
+ "inlineSources": false,
18
+ "newLine": "LF"
19
+ },
20
+ "include": ["./libxfce4util-1.0.d.ts"]
21
+ }
22
+
23
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./libxfce4util-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Libxfce4util-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+