@girs/gtksource-4 4.0.0-4.0.0-beta.2 → 4.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/gtksource-4.d.ts +9 -9
- 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 GtkSource-4, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for GtkSource-4, generated from library version 4.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 GtkSource from '@girs/gtksource-4';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or if you prefer CommonJS, you can also use this:
|
|
26
|
-
```ts
|
|
27
|
-
const GtkSource = require('@girs/gtksource-4');
|
|
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 GtkSource = imports.gi.GtkSource;
|
|
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/gtksource-4.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ import type Pango from '@girs/pango-1.0';
|
|
|
23
23
|
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
24
24
|
import type freetype2 from '@girs/freetype2-2.0';
|
|
25
25
|
import type Gio from '@girs/gio-2.0';
|
|
26
|
-
import type GModule from '@girs/gmodule-2.0';
|
|
27
26
|
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
27
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
28
28
|
import type Atk from '@girs/atk-1.0';
|
|
29
29
|
|
|
30
30
|
export namespace GtkSource {
|
|
@@ -1595,7 +1595,7 @@ export namespace GtkSource {
|
|
|
1595
1595
|
* static void
|
|
1596
1596
|
* my_object_class_init (MyObjectClass *klass)
|
|
1597
1597
|
* {
|
|
1598
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
1598
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1599
1599
|
* 0, 100,
|
|
1600
1600
|
* 50,
|
|
1601
1601
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -2067,7 +2067,7 @@ export namespace GtkSource {
|
|
|
2067
2067
|
* static void
|
|
2068
2068
|
* my_object_class_init (MyObjectClass *klass)
|
|
2069
2069
|
* {
|
|
2070
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
2070
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2071
2071
|
* 0, 100,
|
|
2072
2072
|
* 50,
|
|
2073
2073
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -2633,7 +2633,7 @@ export namespace GtkSource {
|
|
|
2633
2633
|
* static void
|
|
2634
2634
|
* my_object_class_init (MyObjectClass *klass)
|
|
2635
2635
|
* {
|
|
2636
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
2636
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2637
2637
|
* 0, 100,
|
|
2638
2638
|
* 50,
|
|
2639
2639
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -3295,7 +3295,7 @@ export namespace GtkSource {
|
|
|
3295
3295
|
* static void
|
|
3296
3296
|
* my_object_class_init (MyObjectClass *klass)
|
|
3297
3297
|
* {
|
|
3298
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
3298
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
3299
3299
|
* 0, 100,
|
|
3300
3300
|
* 50,
|
|
3301
3301
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -4939,7 +4939,7 @@ export namespace GtkSource {
|
|
|
4939
4939
|
* static void
|
|
4940
4940
|
* my_object_class_init (MyObjectClass *klass)
|
|
4941
4941
|
* {
|
|
4942
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
4942
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
4943
4943
|
* 0, 100,
|
|
4944
4944
|
* 50,
|
|
4945
4945
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -7595,7 +7595,7 @@ export namespace GtkSource {
|
|
|
7595
7595
|
* static void
|
|
7596
7596
|
* my_object_class_init (MyObjectClass *klass)
|
|
7597
7597
|
* {
|
|
7598
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
7598
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
7599
7599
|
* 0, 100,
|
|
7600
7600
|
* 50,
|
|
7601
7601
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -11176,7 +11176,7 @@ export namespace GtkSource {
|
|
|
11176
11176
|
* static void
|
|
11177
11177
|
* my_object_class_init (MyObjectClass *klass)
|
|
11178
11178
|
* {
|
|
11179
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
11179
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
11180
11180
|
* 0, 100,
|
|
11181
11181
|
* 50,
|
|
11182
11182
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
@@ -12295,7 +12295,7 @@ export namespace GtkSource {
|
|
|
12295
12295
|
* static void
|
|
12296
12296
|
* my_object_class_init (MyObjectClass *klass)
|
|
12297
12297
|
* {
|
|
12298
|
-
* properties[PROP_FOO] = g_param_spec_int ("foo",
|
|
12298
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
12299
12299
|
* 0, 100,
|
|
12300
12300
|
* 50,
|
|
12301
12301
|
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gtksource-4",
|
|
3
|
-
"version": "4.0.0-4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-4.0.0-beta.3",
|
|
4
4
|
"description": "GJS TypeScript type definitions for GtkSource-4, generated from library version 4.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gtksource-4.js",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gtksource-4.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": "*"
|