@girs/gdl-3 3.0.0-4.0.0-beta.2 → 3.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 +1 -19
- package/gdl-3.d.ts +13 -13
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Gdl-3, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for Gdl-3, generated from library version 3.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 Gdl from '@girs/gdl-3';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or if you prefer CommonJS, you can also use this:
|
|
26
|
-
```ts
|
|
27
|
-
const Gdl = require('@girs/gdl-3');
|
|
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 Gdl = imports.gi.Gdl;
|
|
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/gdl-3.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ import type Pango from '@girs/pango-1.0';
|
|
|
21
21
|
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
22
22
|
import type freetype2 from '@girs/freetype2-2.0';
|
|
23
23
|
import type Gio from '@girs/gio-2.0';
|
|
24
|
-
import type GModule from '@girs/gmodule-2.0';
|
|
25
24
|
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
25
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
26
26
|
import type Atk from '@girs/atk-1.0';
|
|
27
27
|
|
|
28
28
|
export namespace Gdl {
|
|
@@ -608,7 +608,7 @@ export namespace Gdl {
|
|
|
608
608
|
* static void
|
|
609
609
|
* my_object_class_init (MyObjectClass *klass)
|
|
610
610
|
* {
|
|
611
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
611
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
612
612
|
* 0, 100,
|
|
613
613
|
* 50,
|
|
614
614
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -1040,7 +1040,7 @@ export namespace Gdl {
|
|
|
1040
1040
|
* static void
|
|
1041
1041
|
* my_object_class_init (MyObjectClass *klass)
|
|
1042
1042
|
* {
|
|
1043
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
1043
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1044
1044
|
* 0, 100,
|
|
1045
1045
|
* 50,
|
|
1046
1046
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -1722,7 +1722,7 @@ export namespace Gdl {
|
|
|
1722
1722
|
* static void
|
|
1723
1723
|
* my_object_class_init (MyObjectClass *klass)
|
|
1724
1724
|
* {
|
|
1725
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
1725
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1726
1726
|
* 0, 100,
|
|
1727
1727
|
* 50,
|
|
1728
1728
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -2280,7 +2280,7 @@ export namespace Gdl {
|
|
|
2280
2280
|
* static void
|
|
2281
2281
|
* my_object_class_init (MyObjectClass *klass)
|
|
2282
2282
|
* {
|
|
2283
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
2283
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2284
2284
|
* 0, 100,
|
|
2285
2285
|
* 50,
|
|
2286
2286
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -2691,7 +2691,7 @@ export namespace Gdl {
|
|
|
2691
2691
|
* static void
|
|
2692
2692
|
* my_object_class_init (MyObjectClass *klass)
|
|
2693
2693
|
* {
|
|
2694
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
2694
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2695
2695
|
* 0, 100,
|
|
2696
2696
|
* 50,
|
|
2697
2697
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -3304,7 +3304,7 @@ export namespace Gdl {
|
|
|
3304
3304
|
* static void
|
|
3305
3305
|
* my_object_class_init (MyObjectClass *klass)
|
|
3306
3306
|
* {
|
|
3307
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
3307
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
3308
3308
|
* 0, 100,
|
|
3309
3309
|
* 50,
|
|
3310
3310
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -4037,7 +4037,7 @@ export namespace Gdl {
|
|
|
4037
4037
|
* static void
|
|
4038
4038
|
* my_object_class_init (MyObjectClass *klass)
|
|
4039
4039
|
* {
|
|
4040
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
4040
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
4041
4041
|
* 0, 100,
|
|
4042
4042
|
* 50,
|
|
4043
4043
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -4429,7 +4429,7 @@ export namespace Gdl {
|
|
|
4429
4429
|
* static void
|
|
4430
4430
|
* my_object_class_init (MyObjectClass *klass)
|
|
4431
4431
|
* {
|
|
4432
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
4432
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
4433
4433
|
* 0, 100,
|
|
4434
4434
|
* 50,
|
|
4435
4435
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -4854,7 +4854,7 @@ export namespace Gdl {
|
|
|
4854
4854
|
* static void
|
|
4855
4855
|
* my_object_class_init (MyObjectClass *klass)
|
|
4856
4856
|
* {
|
|
4857
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
4857
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
4858
4858
|
* 0, 100,
|
|
4859
4859
|
* 50,
|
|
4860
4860
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -5278,7 +5278,7 @@ export namespace Gdl {
|
|
|
5278
5278
|
* static void
|
|
5279
5279
|
* my_object_class_init (MyObjectClass *klass)
|
|
5280
5280
|
* {
|
|
5281
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
5281
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
5282
5282
|
* 0, 100,
|
|
5283
5283
|
* 50,
|
|
5284
5284
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -5670,7 +5670,7 @@ export namespace Gdl {
|
|
|
5670
5670
|
* static void
|
|
5671
5671
|
* my_object_class_init (MyObjectClass *klass)
|
|
5672
5672
|
* {
|
|
5673
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
5673
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
5674
5674
|
* 0, 100,
|
|
5675
5675
|
* 50,
|
|
5676
5676
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -6100,7 +6100,7 @@ export namespace Gdl {
|
|
|
6100
6100
|
* static void
|
|
6101
6101
|
* my_object_class_init (MyObjectClass *klass)
|
|
6102
6102
|
* {
|
|
6103
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
6103
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
6104
6104
|
* 0, 100,
|
|
6105
6105
|
* 50,
|
|
6106
6106
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gdl-3",
|
|
3
|
-
"version": "3.0.0-4.0.0-beta.
|
|
3
|
+
"version": "3.0.0-4.0.0-beta.3",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Gdl-3, generated from library version 3.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gdl-3.js",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gdl-3.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.
|
|
30
|
-
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.
|
|
31
|
-
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.
|
|
32
|
-
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.
|
|
33
|
-
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.
|
|
34
|
-
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.
|
|
35
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
36
|
-
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.
|
|
37
|
-
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.
|
|
38
|
-
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.
|
|
39
|
-
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.
|
|
40
|
-
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.
|
|
41
|
-
"@girs/pango-1.0": "^1.51.
|
|
42
|
-
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.
|
|
29
|
+
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.3",
|
|
30
|
+
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.3",
|
|
31
|
+
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.3",
|
|
32
|
+
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.3",
|
|
33
|
+
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.3",
|
|
34
|
+
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
|
|
35
|
+
"@girs/gjs": "^4.0.0-beta.3",
|
|
36
|
+
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
|
|
37
|
+
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.3",
|
|
38
|
+
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3",
|
|
39
|
+
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.3",
|
|
40
|
+
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.3",
|
|
41
|
+
"@girs/pango-1.0": "^1.51.0-4.0.0-beta.3",
|
|
42
|
+
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "*"
|