@girs/gcalc-2 2.0.0-3.2.4 → 2.0.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/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) v3.2.4.
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) v3.2.6.
9
9
 
10
10
 
11
11
  ## Install
@@ -81,6 +81,19 @@ Now you have also type support for this, too:
81
81
  const GCalc = imports.gi.GCalc;
82
82
  ```
83
83
 
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
+
84
97
  ### Bundle
85
98
 
86
99
  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,9 +1,12 @@
1
1
 
2
-
3
2
  declare module 'gi://GCalc?version=2' {
4
3
  import GCalc2 from '@girs/gcalc-2';
5
4
  export default GCalc2;
6
5
  }
7
6
 
7
+ declare module 'gi://GCalc' {
8
+ import GCalc2 from '@girs/gcalc-2';
9
+ export default GCalc2;
10
+ }
8
11
 
9
12
 
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  import GCalc2 from '@girs/gcalc-2';
4
3
 
5
4
  declare global {
package/gcalc-2.d.cts CHANGED
@@ -692,6 +692,7 @@ export module MathFunction {
692
692
  name?: string | null
693
693
  n_params?: number | null
694
694
  closed?: boolean | null
695
+ nParams?: number | null
695
696
  }
696
697
 
697
698
  }
@@ -701,8 +702,10 @@ export interface MathFunction extends GObject.Object, MathExpression {
701
702
  // Own properties of GCalc-2.GCalc.MathFunction
702
703
 
703
704
  readonly param_types: ExpressionContainer
705
+ readonly paramTypes: ExpressionContainer
704
706
  name: string | null
705
707
  n_params: number
708
+ nParams: number
706
709
  closed: boolean
707
710
 
708
711
  // Owm methods of GCalc-2.GCalc.MathFunction
@@ -1756,6 +1759,7 @@ export interface ExpressionContainer extends Gio.ListModel {
1756
1759
  // Conflicting properties
1757
1760
 
1758
1761
  read_only_view: any
1762
+ readOnlyView: any
1759
1763
 
1760
1764
  // Owm methods of GCalc-2.GCalc.ExpressionContainer
1761
1765
 
@@ -3060,6 +3064,7 @@ export module Solver {
3060
3064
  // Own constructor properties of GCalc-2.GCalc.Solver
3061
3065
 
3062
3066
  equation_manager?: MathEquationManager | null
3067
+ equationManager?: MathEquationManager | null
3063
3068
  }
3064
3069
 
3065
3070
  }
@@ -3069,6 +3074,7 @@ export interface Solver {
3069
3074
  // Own properties of GCalc-2.GCalc.Solver
3070
3075
 
3071
3076
  equation_manager: MathEquationManager
3077
+ equationManager: MathEquationManager
3072
3078
 
3073
3079
  // Owm methods of GCalc-2.GCalc.Solver
3074
3080
 
package/gcalc-2.d.ts CHANGED
@@ -694,6 +694,7 @@ module MathFunction {
694
694
  name?: string | null
695
695
  n_params?: number | null
696
696
  closed?: boolean | null
697
+ nParams?: number | null
697
698
  }
698
699
 
699
700
  }
@@ -703,8 +704,10 @@ interface MathFunction extends GObject.Object, MathExpression {
703
704
  // Own properties of GCalc-2.GCalc.MathFunction
704
705
 
705
706
  readonly param_types: ExpressionContainer
707
+ readonly paramTypes: ExpressionContainer
706
708
  name: string | null
707
709
  n_params: number
710
+ nParams: number
708
711
  closed: boolean
709
712
 
710
713
  // Owm methods of GCalc-2.GCalc.MathFunction
@@ -1758,6 +1761,7 @@ interface ExpressionContainer extends Gio.ListModel {
1758
1761
  // Conflicting properties
1759
1762
 
1760
1763
  read_only_view: any
1764
+ readOnlyView: any
1761
1765
 
1762
1766
  // Owm methods of GCalc-2.GCalc.ExpressionContainer
1763
1767
 
@@ -3062,6 +3066,7 @@ module Solver {
3062
3066
  // Own constructor properties of GCalc-2.GCalc.Solver
3063
3067
 
3064
3068
  equation_manager?: MathEquationManager | null
3069
+ equationManager?: MathEquationManager | null
3065
3070
  }
3066
3071
 
3067
3072
  }
@@ -3071,6 +3076,7 @@ interface Solver {
3071
3076
  // Own properties of GCalc-2.GCalc.Solver
3072
3077
 
3073
3078
  equation_manager: MathEquationManager
3079
+ equationManager: MathEquationManager
3074
3080
 
3075
3081
  // Owm methods of GCalc-2.GCalc.Solver
3076
3082
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcalc-2",
3
- "version": "2.0.0-3.2.4",
3
+ "version": "2.0.0-3.2.6",
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",
@@ -25,11 +25,11 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gcalc-2.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/gee-0.8": "^0.8.0-3.2.4",
29
- "@girs/gio-2.0": "^2.78.0-3.2.4",
30
- "@girs/gjs": "^3.2.4",
31
- "@girs/glib-2.0": "^2.78.0-3.2.4",
32
- "@girs/gobject-2.0": "^2.78.0-3.2.4"
28
+ "@girs/gee-0.8": "^0.8.0-3.2.6",
29
+ "@girs/gio-2.0": "^2.78.0-3.2.6",
30
+ "@girs/gjs": "^3.2.6",
31
+ "@girs/glib-2.0": "^2.78.0-3.2.6",
32
+ "@girs/gobject-2.0": "^2.78.0-3.2.6"
33
33
  },
34
34
  "devDependencies": {
35
35
  "typescript": "*"