@girs/glib-2.0 2.80.0-4.0.0-beta.5 → 2.80.2-4.0.0-beta.7

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.80.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.5.
8
+ GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.7.
9
9
 
10
10
 
11
11
  ## Install
@@ -1,12 +1,9 @@
1
-
2
1
  declare module 'gi://GLib?version=2.0' {
3
- import GLib from '@girs/glib-2.0';
4
- export default GLib;
2
+ import GLib20 from '@girs/glib-2.0';
3
+ export default GLib20;
5
4
  }
6
5
 
7
6
  declare module 'gi://GLib' {
8
7
  import GLib20 from 'gi://GLib?version=2.0';
9
8
  export default GLib20;
10
9
  }
11
-
12
-
@@ -1,4 +1,3 @@
1
-
2
1
  import GLib20 from '@girs/glib-2.0';
3
2
 
4
3
  declare global {
@@ -8,5 +7,3 @@ declare global {
8
7
  }
9
8
 
10
9
  export default GjsGiImports;
11
-
12
-
package/glib-2.0.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- /*
1
+ /**
2
2
  * Type Definitions for Gjs (https://gjs.guide/)
3
3
  *
4
4
  * These type definitions are automatically generated, do not edit them by hand.
5
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
+ * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
6
8
  */
7
9
 
8
- import './glib-2.0-ambient.d.ts';
9
-
10
- /**
11
- * GLib-2.0
12
- */
13
-
10
+ // Module dependencies
14
11
  import type GObject from '@girs/gobject-2.0';
15
12
 
16
13
  export namespace GLib {
14
+ /**
15
+ * GLib-2.0
16
+ */
17
+
17
18
  /**
18
19
  * Error codes returned by bookmark file parsing.
19
20
  */
@@ -8564,14 +8565,6 @@ export namespace GLib {
8564
8565
  * @param prgname the name of the program.
8565
8566
  */
8566
8567
  function set_prgname(prgname: string): void;
8567
- /**
8568
- * If g_get_prgname() is not set, this is the same as setting
8569
- * the name via g_set_prgname() and %TRUE is returned. Otherwise,
8570
- * does nothing and returns %FALSE. This is thread-safe.
8571
- * @param prgname the name of the program.
8572
- * @returns whether g_prgname was initialized by the call.
8573
- */
8574
- function set_prgname_once(prgname: string): boolean;
8575
8568
  /**
8576
8569
  * Sets an environment variable. On UNIX, both the variable's name and
8577
8570
  * value can be arbitrary byte strings, except that the variable's name
@@ -13782,7 +13775,7 @@ export namespace GLib {
13782
13775
  * @param uri a valid URI
13783
13776
  * @returns a timestamp
13784
13777
  */
13785
- get_added(uri: string): number;
13778
+ get_added(uri: string): never;
13786
13779
  /**
13787
13780
  * Gets the time the bookmark for `uri` was added to `bookmark`
13788
13781
  *
@@ -13810,7 +13803,7 @@ export namespace GLib {
13810
13803
  * @param name an application's name
13811
13804
  * @returns %TRUE on success.
13812
13805
  */
13813
- get_app_info(uri: string, name: string): [boolean, string, number, number];
13806
+ get_app_info(uri: string, name: string): [boolean, string, number, never | null];
13814
13807
  /**
13815
13808
  * Gets the registration information of `app_name` for the bookmark for
13816
13809
  * `uri`. See g_bookmark_file_set_application_info() for more information about
@@ -13900,7 +13893,7 @@ export namespace GLib {
13900
13893
  * @param uri a valid URI
13901
13894
  * @returns a timestamp
13902
13895
  */
13903
- get_modified(uri: string): number;
13896
+ get_modified(uri: string): never;
13904
13897
  /**
13905
13898
  * Gets the time when the bookmark for `uri` was last modified.
13906
13899
  *
@@ -13941,7 +13934,7 @@ export namespace GLib {
13941
13934
  * @param uri a valid URI
13942
13935
  * @returns a timestamp.
13943
13936
  */
13944
- get_visited(uri: string): number;
13937
+ get_visited(uri: string): never;
13945
13938
  /**
13946
13939
  * Gets the time the bookmark for `uri` was last visited.
13947
13940
  *
@@ -14057,7 +14050,7 @@ export namespace GLib {
14057
14050
  * @param uri a valid URI
14058
14051
  * @param added a timestamp or -1 to use the current time
14059
14052
  */
14060
- set_added(uri: string, added: number): void;
14053
+ set_added(uri: string, added: never): void;
14061
14054
  /**
14062
14055
  * Sets the time the bookmark for `uri` was added into `bookmark`.
14063
14056
  *
@@ -14102,7 +14095,7 @@ export namespace GLib {
14102
14095
  * @param stamp the time of the last registration for this application
14103
14096
  * @returns %TRUE if the application's meta-data was successfully changed.
14104
14097
  */
14105
- set_app_info(uri: string, name: string, exec: string, count: number, stamp: number): boolean;
14098
+ set_app_info(uri: string, name: string, exec: string, count: number, stamp: never): boolean;
14106
14099
  /**
14107
14100
  * Sets the meta-data of application `name` inside the list of
14108
14101
  * applications that have registered a bookmark for `uri` inside
@@ -14197,7 +14190,7 @@ export namespace GLib {
14197
14190
  * @param uri a valid URI
14198
14191
  * @param modified a timestamp or -1 to use the current time
14199
14192
  */
14200
- set_modified(uri: string, modified: number): void;
14193
+ set_modified(uri: string, modified: never): void;
14201
14194
  /**
14202
14195
  * Sets the last time the bookmark for `uri` was last modified.
14203
14196
  *
@@ -14235,7 +14228,7 @@ export namespace GLib {
14235
14228
  * @param uri a valid URI
14236
14229
  * @param visited a timestamp or -1 to use the current time
14237
14230
  */
14238
- set_visited(uri: string, visited: number): void;
14231
+ set_visited(uri: string, visited: never): void;
14239
14232
  /**
14240
14233
  * Sets the time the bookmark for `uri` was last visited.
14241
14234
  *
@@ -15384,7 +15377,7 @@ export namespace GLib {
15384
15377
  *
15385
15378
  * @param timet time_t value to set
15386
15379
  */
15387
- set_time_t(timet: number): void;
15380
+ set_time_t(timet: never): void;
15388
15381
  /**
15389
15382
  * Sets the value of a date from a #GTimeVal value. Note that the
15390
15383
  * `tv_usec` member is ignored, because #GDate can't make use of the
@@ -16577,24 +16570,85 @@ export namespace GLib {
16577
16570
  steal(): void;
16578
16571
  }
16579
16572
 
16573
+ /**
16574
+ * HMACs should be used when producing a cookie or hash based on data
16575
+ * and a key. Simple mechanisms for using SHA1 and other algorithms to
16576
+ * digest a key and data together are vulnerable to various security
16577
+ * issues.
16578
+ * [HMAC](http://en.wikipedia.org/wiki/HMAC)
16579
+ * uses algorithms like SHA1 in a secure way to produce a digest of a
16580
+ * key and data.
16581
+ *
16582
+ * Both the key and data are arbitrary byte arrays of bytes or characters.
16583
+ *
16584
+ * Support for HMAC Digests has been added in GLib 2.30, and support for SHA-512
16585
+ * in GLib 2.42. Support for SHA-384 was added in GLib 2.52.
16586
+ *
16587
+ * To create a new `GHmac`, use [ctor`GLib`.Hmac.new]. To free a `GHmac`, use
16588
+ * [method`GLib`.Hmac.unref].
16589
+ */
16580
16590
  class Hmac {
16581
16591
  static $gtype: GObject.GType<Hmac>;
16582
16592
 
16583
16593
  // Constructors of GLib.Hmac
16584
16594
 
16585
- constructor(digest_type: ChecksumType, key: number, key_len: number);
16595
+ constructor(digest_type: ChecksumType, key: Uint8Array | string);
16586
16596
  _init(...args: any[]): void;
16587
16597
 
16588
- static ['new'](digest_type: ChecksumType, key: number, key_len: number): Hmac;
16598
+ static ['new'](digest_type: ChecksumType, key: Uint8Array | string): Hmac;
16589
16599
 
16590
16600
  // Own methods of GLib.Hmac
16591
16601
 
16602
+ /**
16603
+ * Copies a #GHmac. If `hmac` has been closed, by calling
16604
+ * g_hmac_get_string() or g_hmac_get_digest(), the copied
16605
+ * HMAC will be closed as well.
16606
+ * @returns the copy of the passed #GHmac. Use g_hmac_unref() when finished using it.
16607
+ */
16592
16608
  copy(): Hmac;
16593
- get_digest(buffer: number, digest_len: number): void;
16609
+ /**
16610
+ * Gets the digest from `checksum` as a raw binary array and places it
16611
+ * into `buffer`. The size of the digest depends on the type of checksum.
16612
+ *
16613
+ * Once this function has been called, the #GHmac is closed and can
16614
+ * no longer be updated with g_checksum_update().
16615
+ * @param buffer output buffer
16616
+ */
16617
+ get_digest(buffer: Uint8Array | string): void;
16618
+ /**
16619
+ * Gets the HMAC as a hexadecimal string.
16620
+ *
16621
+ * Once this function has been called the #GHmac can no longer be
16622
+ * updated with g_hmac_update().
16623
+ *
16624
+ * The hexadecimal characters will be lower case.
16625
+ * @returns the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
16626
+ */
16594
16627
  get_string(): string;
16628
+ /**
16629
+ * Atomically increments the reference count of `hmac` by one.
16630
+ *
16631
+ * This function is MT-safe and may be called from any thread.
16632
+ * @returns the passed in #GHmac.
16633
+ */
16595
16634
  ref(): Hmac;
16635
+ /**
16636
+ * Atomically decrements the reference count of `hmac` by one.
16637
+ *
16638
+ * If the reference count drops to 0, all keys and values will be
16639
+ * destroyed, and all memory allocated by the hash table is released.
16640
+ * This function is MT-safe and may be called from any thread.
16641
+ * Frees the memory allocated for `hmac`.
16642
+ */
16596
16643
  unref(): void;
16597
- update(data: number, length: number): void;
16644
+ /**
16645
+ * Feeds `data` into an existing #GHmac.
16646
+ *
16647
+ * The HMAC must still be open, that is g_hmac_get_string() or
16648
+ * g_hmac_get_digest() must not have been called on `hmac`.
16649
+ * @param data buffer used to compute the checksum
16650
+ */
16651
+ update(data: Uint8Array | string): void;
16598
16652
  }
16599
16653
 
16600
16654
  /**
@@ -26427,4 +26481,5 @@ export namespace GLib {
26427
26481
  }
26428
26482
 
26429
26483
  export default GLib;
26484
+
26430
26485
  // END
package/glib-2.0.js CHANGED
@@ -1,6 +1,5 @@
1
1
 
2
- // @ts-expect-error
3
- import GLib from 'gi://GLib?version=2.0';
4
- export { GLib };
5
- export default GLib;
2
+ // @ts-expect-error
3
+ import GLib from 'gi://GLib?version=2.0';
4
+ export default GLib;
6
5
 
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
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
+ * This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import './glib-2.0-ambient.d.ts';
11
+
12
+ import './glib-2.0-import.d.ts';
13
+
14
+ import GLib from './glib-2.0.js';
15
+ export default GLib;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GLib from './glib-2.0.js';
4
+ export default GLib;
5
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@girs/glib-2.0",
3
- "version": "2.80.0-4.0.0-beta.5",
4
- "description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.0",
3
+ "version": "2.80.2-4.0.0-beta.7",
4
+ "description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.2",
5
5
  "type": "module",
6
6
  "module": "glib-2.0.js",
7
7
  "main": "glib-2.0.js",
@@ -16,18 +16,23 @@
16
16
  "import": "./glib-2.0-import.js",
17
17
  "default": "./glib-2.0-import.js"
18
18
  },
19
- ".": {
19
+ "./glib-2.0": {
20
20
  "types": "./glib-2.0.d.ts",
21
21
  "import": "./glib-2.0.js",
22
22
  "default": "./glib-2.0.js"
23
+ },
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js",
27
+ "default": "./index.js"
23
28
  }
24
29
  },
25
30
  "scripts": {
26
- "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit glib-2.0.d.ts"
31
+ "test": "tsc --project tsconfig.json"
27
32
  },
28
33
  "dependencies": {
29
- "@girs/gjs": "^4.0.0-beta.5",
30
- "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.5"
34
+ "@girs/gjs": "^4.0.0-beta.7",
35
+ "@girs/gobject-2.0": "^2.80.2-4.0.0-beta.7"
31
36
  },
32
37
  "devDependencies": {
33
38
  "typescript": "*"
package/tsconfig.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "compilerOptions": {
3
3
  // General settings for code interpretation
4
4
  "target": "ESNext",
5
- "module": "ESNext",
5
+ "module": "NodeNext",
6
6
  "lib": ["ESNext"],
7
7
  "types": [],
8
8
  "experimentalDecorators": true,
9
- "moduleResolution": "node",
9
+ "moduleResolution": "NodeNext",
10
10
  "noEmit": true,
11
11
  "noEmitOnError": false,
12
12
  "baseUrl": "./",