@girs/gcalc-2 2.0.0-4.0.0-beta.2 → 2.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.
Files changed (3) hide show
  1. package/README.md +1 -19
  2. package/gcalc-2.d.ts +19 -20
  3. package/package.json +6 -7
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gcalc-2)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GCalc-2, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.2.
8
+ GJS TypeScript type definitions for GCalc-2, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
9
9
 
10
10
 
11
11
  ## Install
@@ -22,11 +22,6 @@ You can import this package into your project like this:
22
22
  import GCalc from '@girs/gcalc-2';
23
23
  ```
24
24
 
25
- Or if you prefer CommonJS, you can also use this:
26
- ```ts
27
- const GCalc = require('@girs/gcalc-2');
28
- ```
29
-
30
25
  ### Ambient Modules
31
26
 
32
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.
@@ -81,19 +76,6 @@ Now you have also type support for this, too:
81
76
  const GCalc = imports.gi.GCalc;
82
77
  ```
83
78
 
84
-
85
- ### ESM vs. CommonJS
86
-
87
- GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
88
-
89
- 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.
90
-
91
- 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.
92
-
93
- 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.
94
-
95
- 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.
96
-
97
79
  ### Bundle
98
80
 
99
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).
package/gcalc-2.d.ts CHANGED
@@ -14,7 +14,6 @@ import './gcalc-2-ambient.d.ts';
14
14
  import type Gio from '@girs/gio-2.0';
15
15
  import type GObject from '@girs/gobject-2.0';
16
16
  import type GLib from '@girs/glib-2.0';
17
- import type GModule from '@girs/gmodule-2.0';
18
17
  import type Gee from '@girs/gee-0.8';
19
18
 
20
19
  export namespace GCalc {
@@ -369,7 +368,7 @@ export namespace GCalc {
369
368
  * static void
370
369
  * my_object_class_init (MyObjectClass *klass)
371
370
  * {
372
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
371
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
373
372
  * 0, 100,
374
373
  * 50,
375
374
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -833,7 +832,7 @@ export namespace GCalc {
833
832
  * static void
834
833
  * my_object_class_init (MyObjectClass *klass)
835
834
  * {
836
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
835
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
837
836
  * 0, 100,
838
837
  * 50,
839
838
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1212,7 +1211,7 @@ export namespace GCalc {
1212
1211
  * static void
1213
1212
  * my_object_class_init (MyObjectClass *klass)
1214
1213
  * {
1215
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
1214
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1216
1215
  * 0, 100,
1217
1216
  * 50,
1218
1217
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1592,7 +1591,7 @@ export namespace GCalc {
1592
1591
  * static void
1593
1592
  * my_object_class_init (MyObjectClass *klass)
1594
1593
  * {
1595
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
1594
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1596
1595
  * 0, 100,
1597
1596
  * 50,
1598
1597
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1977,7 +1976,7 @@ export namespace GCalc {
1977
1976
  * static void
1978
1977
  * my_object_class_init (MyObjectClass *klass)
1979
1978
  * {
1980
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
1979
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1981
1980
  * 0, 100,
1982
1981
  * 50,
1983
1982
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -2365,7 +2364,7 @@ export namespace GCalc {
2365
2364
  * static void
2366
2365
  * my_object_class_init (MyObjectClass *klass)
2367
2366
  * {
2368
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
2367
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
2369
2368
  * 0, 100,
2370
2369
  * 50,
2371
2370
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -2761,7 +2760,7 @@ export namespace GCalc {
2761
2760
  * static void
2762
2761
  * my_object_class_init (MyObjectClass *klass)
2763
2762
  * {
2764
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
2763
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
2765
2764
  * 0, 100,
2766
2765
  * 50,
2767
2766
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -3268,7 +3267,7 @@ export namespace GCalc {
3268
3267
  * static void
3269
3268
  * my_object_class_init (MyObjectClass *klass)
3270
3269
  * {
3271
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
3270
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
3272
3271
  * 0, 100,
3273
3272
  * 50,
3274
3273
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -3723,7 +3722,7 @@ export namespace GCalc {
3723
3722
  * static void
3724
3723
  * my_object_class_init (MyObjectClass *klass)
3725
3724
  * {
3726
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
3725
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
3727
3726
  * 0, 100,
3728
3727
  * 50,
3729
3728
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -4384,7 +4383,7 @@ export namespace GCalc {
4384
4383
  * static void
4385
4384
  * my_object_class_init (MyObjectClass *klass)
4386
4385
  * {
4387
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
4386
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
4388
4387
  * 0, 100,
4389
4388
  * 50,
4390
4389
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -4763,7 +4762,7 @@ export namespace GCalc {
4763
4762
  * static void
4764
4763
  * my_object_class_init (MyObjectClass *klass)
4765
4764
  * {
4766
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
4765
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
4767
4766
  * 0, 100,
4768
4767
  * 50,
4769
4768
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -5142,7 +5141,7 @@ export namespace GCalc {
5142
5141
  * static void
5143
5142
  * my_object_class_init (MyObjectClass *klass)
5144
5143
  * {
5145
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
5144
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
5146
5145
  * 0, 100,
5147
5146
  * 50,
5148
5147
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -5532,7 +5531,7 @@ export namespace GCalc {
5532
5531
  * static void
5533
5532
  * my_object_class_init (MyObjectClass *klass)
5534
5533
  * {
5535
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
5534
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
5536
5535
  * 0, 100,
5537
5536
  * 50,
5538
5537
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -5935,7 +5934,7 @@ export namespace GCalc {
5935
5934
  * static void
5936
5935
  * my_object_class_init (MyObjectClass *klass)
5937
5936
  * {
5938
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
5937
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
5939
5938
  * 0, 100,
5940
5939
  * 50,
5941
5940
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -6312,7 +6311,7 @@ export namespace GCalc {
6312
6311
  * static void
6313
6312
  * my_object_class_init (MyObjectClass *klass)
6314
6313
  * {
6315
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
6314
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
6316
6315
  * 0, 100,
6317
6316
  * 50,
6318
6317
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -6690,7 +6689,7 @@ export namespace GCalc {
6690
6689
  * static void
6691
6690
  * my_object_class_init (MyObjectClass *klass)
6692
6691
  * {
6693
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
6692
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
6694
6693
  * 0, 100,
6695
6694
  * 50,
6696
6695
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -7072,7 +7071,7 @@ export namespace GCalc {
7072
7071
  * static void
7073
7072
  * my_object_class_init (MyObjectClass *klass)
7074
7073
  * {
7075
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
7074
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
7076
7075
  * 0, 100,
7077
7076
  * 50,
7078
7077
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -7486,7 +7485,7 @@ export namespace GCalc {
7486
7485
  * static void
7487
7486
  * my_object_class_init (MyObjectClass *klass)
7488
7487
  * {
7489
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
7488
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
7490
7489
  * 0, 100,
7491
7490
  * 50,
7492
7491
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -7910,7 +7909,7 @@ export namespace GCalc {
7910
7909
  * static void
7911
7910
  * my_object_class_init (MyObjectClass *klass)
7912
7911
  * {
7913
- * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
7912
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
7914
7913
  * 0, 100,
7915
7914
  * 50,
7916
7915
  * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcalc-2",
3
- "version": "2.0.0-4.0.0-beta.2",
3
+ "version": "2.0.0-4.0.0-beta.3",
4
4
  "description": "GJS TypeScript type definitions for GCalc-2, generated from library version 2.0.0",
5
5
  "type": "module",
6
6
  "module": "gcalc-2.js",
@@ -26,12 +26,11 @@
26
26
  "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gcalc-2.d.ts"
27
27
  },
28
28
  "dependencies": {
29
- "@girs/gee-0.8": "^0.8.0-4.0.0-beta.2",
30
- "@girs/gio-2.0": "^2.80.0-4.0.0-beta.2",
31
- "@girs/gjs": "^4.0.0-beta.2",
32
- "@girs/glib-2.0": "^2.80.0-4.0.0-beta.2",
33
- "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.2",
34
- "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.2"
29
+ "@girs/gee-0.8": "^0.8.0-4.0.0-beta.3",
30
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
31
+ "@girs/gjs": "^4.0.0-beta.3",
32
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
33
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
35
34
  },
36
35
  "devDependencies": {
37
36
  "typescript": "*"