@girs/gnomedesktop-4.0 4.0.0-3.2.4 → 4.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/gnomedesktop-4.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GnomeDesktop-4.0, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.4.
8
+ GJS TypeScript type definitions for GnomeDesktop-4.0, generated from library version 4.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 GnomeDesktop = imports.gi.GnomeDesktop;
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://GnomeDesktop?version=4.0' {
4
3
  import GnomeDesktop40 from '@girs/gnomedesktop-4.0';
5
4
  export default GnomeDesktop40;
6
5
  }
7
6
 
7
+ declare module 'gi://GnomeDesktop' {
8
+ import GnomeDesktop40 from '@girs/gnomedesktop-4.0';
9
+ export default GnomeDesktop40;
10
+ }
8
11
 
9
12
 
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  import GnomeDesktop40 from '@girs/gnomedesktop-4.0';
4
3
 
5
4
  declare global {
@@ -500,6 +500,17 @@ export module WallClock {
500
500
  * day of the week, irrespective of configuration.
501
501
  */
502
502
  time_only?: boolean | null
503
+ /**
504
+ * If %TRUE, the formatted clock will always have seconds precision and the
505
+ * 'clock' property will always be updated every second, irrespective of
506
+ * system configuration.
507
+ */
508
+ forceSeconds?: boolean | null
509
+ /**
510
+ * If %TRUE, the formatted clock will never include a date or the
511
+ * day of the week, irrespective of configuration.
512
+ */
513
+ timeOnly?: boolean | null
503
514
  }
504
515
 
505
516
  }
@@ -518,11 +529,22 @@ export interface WallClock {
518
529
  * system configuration.
519
530
  */
520
531
  force_seconds: boolean
532
+ /**
533
+ * If %TRUE, the formatted clock will always have seconds precision and the
534
+ * 'clock' property will always be updated every second, irrespective of
535
+ * system configuration.
536
+ */
537
+ forceSeconds: boolean
521
538
  /**
522
539
  * If %TRUE, the formatted clock will never include a date or the
523
540
  * day of the week, irrespective of configuration.
524
541
  */
525
542
  time_only: boolean
543
+ /**
544
+ * If %TRUE, the formatted clock will never include a date or the
545
+ * day of the week, irrespective of configuration.
546
+ */
547
+ timeOnly: boolean
526
548
  /**
527
549
  * The timezone used for this clock
528
550
  */
@@ -502,6 +502,17 @@ module WallClock {
502
502
  * day of the week, irrespective of configuration.
503
503
  */
504
504
  time_only?: boolean | null
505
+ /**
506
+ * If %TRUE, the formatted clock will always have seconds precision and the
507
+ * 'clock' property will always be updated every second, irrespective of
508
+ * system configuration.
509
+ */
510
+ forceSeconds?: boolean | null
511
+ /**
512
+ * If %TRUE, the formatted clock will never include a date or the
513
+ * day of the week, irrespective of configuration.
514
+ */
515
+ timeOnly?: boolean | null
505
516
  }
506
517
 
507
518
  }
@@ -520,11 +531,22 @@ interface WallClock {
520
531
  * system configuration.
521
532
  */
522
533
  force_seconds: boolean
534
+ /**
535
+ * If %TRUE, the formatted clock will always have seconds precision and the
536
+ * 'clock' property will always be updated every second, irrespective of
537
+ * system configuration.
538
+ */
539
+ forceSeconds: boolean
523
540
  /**
524
541
  * If %TRUE, the formatted clock will never include a date or the
525
542
  * day of the week, irrespective of configuration.
526
543
  */
527
544
  time_only: boolean
545
+ /**
546
+ * If %TRUE, the formatted clock will never include a date or the
547
+ * day of the week, irrespective of configuration.
548
+ */
549
+ timeOnly: boolean
528
550
  /**
529
551
  * The timezone used for this clock
530
552
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gnomedesktop-4.0",
3
- "version": "4.0.0-3.2.4",
3
+ "version": "4.0.0-3.2.6",
4
4
  "description": "GJS TypeScript type definitions for GnomeDesktop-4.0, generated from library version 4.0.0",
5
5
  "type": "module",
6
6
  "module": "gnomedesktop-4.0.js",
@@ -25,13 +25,13 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gnomedesktop-4.0.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/gdesktopenums-3.0": "^3.0.0-3.2.4",
29
- "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.4",
30
- "@girs/gio-2.0": "^2.78.0-3.2.4",
31
- "@girs/gjs": "^3.2.4",
32
- "@girs/glib-2.0": "^2.78.0-3.2.4",
33
- "@girs/gmodule-2.0": "^2.0.0-3.2.4",
34
- "@girs/gobject-2.0": "^2.78.0-3.2.4"
28
+ "@girs/gdesktopenums-3.0": "^3.0.0-3.2.6",
29
+ "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.6",
30
+ "@girs/gio-2.0": "^2.78.0-3.2.6",
31
+ "@girs/gjs": "^3.2.6",
32
+ "@girs/glib-2.0": "^2.78.0-3.2.6",
33
+ "@girs/gmodule-2.0": "^2.0.0-3.2.6",
34
+ "@girs/gobject-2.0": "^2.78.0-3.2.6"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "*"