@girs/gobject-2.0 2.78.0-3.2.4 → 2.78.0-3.2.6

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/gobject-2.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GObject-2.0, generated from library version 2.78.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.4.
8
+ GJS TypeScript type definitions for GObject-2.0, generated from library version 2.78.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.6.
9
9
 
10
10
  GObject provides the object system used for Pango and GTK+.
11
11
 
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
82
82
  const GObject = imports.gi.GObject;
83
83
  ```
84
84
 
85
+
86
+ ### ESM vs. CommonJS
87
+
88
+ GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
89
+
90
+ 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.
91
+
92
+ 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.
93
+
94
+ 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.
95
+
96
+ 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.
97
+
85
98
  ### Bundle
86
99
 
87
100
  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).
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  declare module 'gi://GObject?version=2.0' {
4
3
  import GObject20 from '@girs/gobject-2.0';
5
4
  export default GObject20;
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  import GObject20 from '@girs/gobject-2.0';
4
3
 
5
4
  declare global {
package/gobject-2.0.d.cts CHANGED
@@ -3055,6 +3055,22 @@ export module Binding {
3055
3055
  * best performance.
3056
3056
  */
3057
3057
  target_property?: string | null
3058
+ /**
3059
+ * The name of the property of #GBinding:source that should be used
3060
+ * as the source of the binding.
3061
+ *
3062
+ * This should be in [canonical form][canonical-parameter-names] to get the
3063
+ * best performance.
3064
+ */
3065
+ sourceProperty?: string | null
3066
+ /**
3067
+ * The name of the property of #GBinding:target that should be used
3068
+ * as the target of the binding.
3069
+ *
3070
+ * This should be in [canonical form][canonical-parameter-names] to get the
3071
+ * best performance.
3072
+ */
3073
+ targetProperty?: string | null
3058
3074
  }
3059
3075
 
3060
3076
  }
@@ -3079,6 +3095,14 @@ export interface Binding {
3079
3095
  * best performance.
3080
3096
  */
3081
3097
  readonly source_property: string | null
3098
+ /**
3099
+ * The name of the property of #GBinding:source that should be used
3100
+ * as the source of the binding.
3101
+ *
3102
+ * This should be in [canonical form][canonical-parameter-names] to get the
3103
+ * best performance.
3104
+ */
3105
+ readonly sourceProperty: string | null
3082
3106
  /**
3083
3107
  * The #GObject that should be used as the target of the binding
3084
3108
  */
@@ -3091,6 +3115,14 @@ export interface Binding {
3091
3115
  * best performance.
3092
3116
  */
3093
3117
  readonly target_property: string | null
3118
+ /**
3119
+ * The name of the property of #GBinding:target that should be used
3120
+ * as the target of the binding.
3121
+ *
3122
+ * This should be in [canonical form][canonical-parameter-names] to get the
3123
+ * best performance.
3124
+ */
3125
+ readonly targetProperty: string | null
3094
3126
 
3095
3127
  // Owm methods of GObject-2.0.GObject.Binding
3096
3128
 
@@ -4899,6 +4931,10 @@ export module SignalGroup {
4899
4931
  * The #GType of the target property.
4900
4932
  */
4901
4933
  target_type?: GType | null
4934
+ /**
4935
+ * The #GType of the target property.
4936
+ */
4937
+ targetType?: GType | null
4902
4938
  }
4903
4939
 
4904
4940
  }
@@ -4915,6 +4951,10 @@ export interface SignalGroup {
4915
4951
  * The #GType of the target property.
4916
4952
  */
4917
4953
  readonly target_type: GType
4954
+ /**
4955
+ * The #GType of the target property.
4956
+ */
4957
+ readonly targetType: GType
4918
4958
 
4919
4959
  // Owm methods of GObject-2.0.GObject.SignalGroup
4920
4960
 
package/gobject-2.0.d.ts CHANGED
@@ -3057,6 +3057,22 @@ module Binding {
3057
3057
  * best performance.
3058
3058
  */
3059
3059
  target_property?: string | null
3060
+ /**
3061
+ * The name of the property of #GBinding:source that should be used
3062
+ * as the source of the binding.
3063
+ *
3064
+ * This should be in [canonical form][canonical-parameter-names] to get the
3065
+ * best performance.
3066
+ */
3067
+ sourceProperty?: string | null
3068
+ /**
3069
+ * The name of the property of #GBinding:target that should be used
3070
+ * as the target of the binding.
3071
+ *
3072
+ * This should be in [canonical form][canonical-parameter-names] to get the
3073
+ * best performance.
3074
+ */
3075
+ targetProperty?: string | null
3060
3076
  }
3061
3077
 
3062
3078
  }
@@ -3081,6 +3097,14 @@ interface Binding {
3081
3097
  * best performance.
3082
3098
  */
3083
3099
  readonly source_property: string | null
3100
+ /**
3101
+ * The name of the property of #GBinding:source that should be used
3102
+ * as the source of the binding.
3103
+ *
3104
+ * This should be in [canonical form][canonical-parameter-names] to get the
3105
+ * best performance.
3106
+ */
3107
+ readonly sourceProperty: string | null
3084
3108
  /**
3085
3109
  * The #GObject that should be used as the target of the binding
3086
3110
  */
@@ -3093,6 +3117,14 @@ interface Binding {
3093
3117
  * best performance.
3094
3118
  */
3095
3119
  readonly target_property: string | null
3120
+ /**
3121
+ * The name of the property of #GBinding:target that should be used
3122
+ * as the target of the binding.
3123
+ *
3124
+ * This should be in [canonical form][canonical-parameter-names] to get the
3125
+ * best performance.
3126
+ */
3127
+ readonly targetProperty: string | null
3096
3128
 
3097
3129
  // Owm methods of GObject-2.0.GObject.Binding
3098
3130
 
@@ -4901,6 +4933,10 @@ module SignalGroup {
4901
4933
  * The #GType of the target property.
4902
4934
  */
4903
4935
  target_type?: GType | null
4936
+ /**
4937
+ * The #GType of the target property.
4938
+ */
4939
+ targetType?: GType | null
4904
4940
  }
4905
4941
 
4906
4942
  }
@@ -4917,6 +4953,10 @@ interface SignalGroup {
4917
4953
  * The #GType of the target property.
4918
4954
  */
4919
4955
  readonly target_type: GType
4956
+ /**
4957
+ * The #GType of the target property.
4958
+ */
4959
+ readonly targetType: GType
4920
4960
 
4921
4961
  // Owm methods of GObject-2.0.GObject.SignalGroup
4922
4962
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gobject-2.0",
3
- "version": "2.78.0-3.2.4",
3
+ "version": "2.78.0-3.2.6",
4
4
  "description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.78.0",
5
5
  "type": "module",
6
6
  "module": "gobject-2.0.js",
@@ -25,8 +25,8 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gobject-2.0.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/gjs": "^3.2.4",
29
- "@girs/glib-2.0": "^2.78.0-3.2.4"
28
+ "@girs/gjs": "^3.2.6",
29
+ "@girs/glib-2.0": "^2.78.0-3.2.6"
30
30
  },
31
31
  "devDependencies": {
32
32
  "typescript": "*"