@girs/peas-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/peas-2)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Peas-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 Peas-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 Peas = imports.gi.Peas;
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).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/peas-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 Peas-2, generated from library version 2.0.0",
5
5
  "type": "module",
6
6
  "module": "peas-2.js",
@@ -25,11 +25,11 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit peas-2.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/gio-2.0": "^2.78.0-3.2.4",
29
- "@girs/gjs": "^3.2.4",
30
- "@girs/glib-2.0": "^2.78.0-3.2.4",
31
- "@girs/gmodule-2.0": "^2.0.0-3.2.4",
32
- "@girs/gobject-2.0": "^2.78.0-3.2.4"
28
+ "@girs/gio-2.0": "^2.78.0-3.2.6",
29
+ "@girs/gjs": "^3.2.6",
30
+ "@girs/glib-2.0": "^2.78.0-3.2.6",
31
+ "@girs/gmodule-2.0": "^2.0.0-3.2.6",
32
+ "@girs/gobject-2.0": "^2.78.0-3.2.6"
33
33
  },
34
34
  "devDependencies": {
35
35
  "typescript": "*"
@@ -1,9 +1,12 @@
1
1
 
2
-
3
2
  declare module 'gi://Peas?version=2' {
4
3
  import Peas2 from '@girs/peas-2';
5
4
  export default Peas2;
6
5
  }
7
6
 
7
+ declare module 'gi://Peas' {
8
+ import Peas2 from '@girs/peas-2';
9
+ export default Peas2;
10
+ }
8
11
 
9
12
 
@@ -1,5 +1,4 @@
1
1
 
2
-
3
2
  import Peas2 from '@girs/peas-2';
4
3
 
5
4
  declare global {
package/peas-2.d.cts CHANGED
@@ -114,6 +114,32 @@ export module Engine {
114
114
  * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
115
115
  */
116
116
  nonglobal_loaders?: boolean | null
117
+ /**
118
+ * The list of loaded plugins.
119
+ *
120
+ * This will be modified when [method`Engine`.load_plugin] or
121
+ * [method`Engine`.unload_plugin] is called.
122
+ *
123
+ * This can be used with [class`Gio`.Settings] to save the loaded plugins by
124
+ * binding to this property after instantiating the engine by doing:
125
+ *
126
+ * ```c
127
+ * g_settings_bind (gsettings_object,
128
+ * LOADED_PLUGINS_KEY,
129
+ * engine,
130
+ * "loaded-plugins",
131
+ * G_SETTINGS_BIND_DEFAULT);
132
+ * ```
133
+ *
134
+ * Note: notify will not be called when the engine is being destroyed.
135
+ */
136
+ loadedPlugins?: string[] | null
137
+ /**
138
+ * If non-global plugin loaders should be used.
139
+ *
140
+ * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
141
+ */
142
+ nonglobalLoaders?: boolean | null
117
143
  }
118
144
 
119
145
  }
@@ -142,12 +168,38 @@ export interface Engine extends Gio.ListModel {
142
168
  * Note: notify will not be called when the engine is being destroyed.
143
169
  */
144
170
  loaded_plugins: string[]
171
+ /**
172
+ * The list of loaded plugins.
173
+ *
174
+ * This will be modified when [method`Engine`.load_plugin] or
175
+ * [method`Engine`.unload_plugin] is called.
176
+ *
177
+ * This can be used with [class`Gio`.Settings] to save the loaded plugins by
178
+ * binding to this property after instantiating the engine by doing:
179
+ *
180
+ * ```c
181
+ * g_settings_bind (gsettings_object,
182
+ * LOADED_PLUGINS_KEY,
183
+ * engine,
184
+ * "loaded-plugins",
185
+ * G_SETTINGS_BIND_DEFAULT);
186
+ * ```
187
+ *
188
+ * Note: notify will not be called when the engine is being destroyed.
189
+ */
190
+ loadedPlugins: string[]
145
191
  /**
146
192
  * If non-global plugin loaders should be used.
147
193
  *
148
194
  * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
149
195
  */
150
196
  readonly nonglobal_loaders: boolean
197
+ /**
198
+ * If non-global plugin loaders should be used.
199
+ *
200
+ * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
201
+ */
202
+ readonly nonglobalLoaders: boolean
151
203
 
152
204
  // Owm methods of Peas-2.Peas.Engine
153
205
 
@@ -380,6 +432,10 @@ export module ExtensionBase {
380
432
  * The [class`PluginInfo]` related to the current plugin.
381
433
  */
382
434
  plugin_info?: PluginInfo | null
435
+ /**
436
+ * The [class`PluginInfo]` related to the current plugin.
437
+ */
438
+ pluginInfo?: PluginInfo | null
383
439
  }
384
440
 
385
441
  }
@@ -396,10 +452,22 @@ export interface ExtensionBase {
396
452
  * [method`PluginInfo`.get_data_dir].
397
453
  */
398
454
  readonly data_dir: string | null
455
+ /**
456
+ * The The full path of the directory where the plugin
457
+ * should look for its data files.
458
+ *
459
+ * Note: This is the same path as that returned by
460
+ * [method`PluginInfo`.get_data_dir].
461
+ */
462
+ readonly dataDir: string | null
399
463
  /**
400
464
  * The [class`PluginInfo]` related to the current plugin.
401
465
  */
402
466
  readonly plugin_info: PluginInfo
467
+ /**
468
+ * The [class`PluginInfo]` related to the current plugin.
469
+ */
470
+ readonly pluginInfo: PluginInfo
403
471
 
404
472
  // Own fields of Peas-2.Peas.ExtensionBase
405
473
 
@@ -487,6 +555,8 @@ export module ExtensionSet {
487
555
  construct_properties?: any | null
488
556
  engine?: Engine | null
489
557
  extension_type?: GObject.GType | null
558
+ constructProperties?: any | null
559
+ extensionType?: GObject.GType | null
490
560
  }
491
561
 
492
562
  }
@@ -496,8 +566,10 @@ export interface ExtensionSet extends Gio.ListModel {
496
566
  // Own properties of Peas-2.Peas.ExtensionSet
497
567
 
498
568
  readonly construct_properties: any
569
+ readonly constructProperties: any
499
570
  readonly engine: Engine
500
571
  readonly extension_type: GObject.GType
572
+ readonly extensionType: GObject.GType
501
573
 
502
574
  // Owm methods of Peas-2.Peas.ExtensionSet
503
575
 
@@ -652,6 +724,11 @@ export module ObjectModule {
652
724
  path?: string | null
653
725
  resident?: boolean | null
654
726
  symbol?: string | null
727
+ /**
728
+ * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
729
+ */
730
+ localLinkage?: boolean | null
731
+ moduleName?: string | null
655
732
  }
656
733
 
657
734
  }
@@ -664,7 +741,12 @@ export interface ObjectModule extends GObject.TypePlugin {
664
741
  * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
665
742
  */
666
743
  readonly local_linkage: boolean
744
+ /**
745
+ * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
746
+ */
747
+ readonly localLinkage: boolean
667
748
  readonly module_name: string | null
749
+ readonly moduleName: string | null
668
750
  readonly path: string | null
669
751
  readonly resident: boolean
670
752
  readonly symbol: string | null
@@ -785,11 +867,15 @@ export interface PluginInfo {
785
867
  readonly dependencies: string[]
786
868
  readonly description: string | null
787
869
  readonly help_uri: string | null
870
+ readonly helpUri: string | null
788
871
  readonly hidden: boolean
789
872
  readonly icon_name: string | null
873
+ readonly iconName: string | null
790
874
  readonly loaded: boolean
791
875
  readonly module_dir: string | null
876
+ readonly moduleDir: string | null
792
877
  readonly module_name: string | null
878
+ readonly moduleName: string | null
793
879
  readonly name: string | null
794
880
  readonly version: string | null
795
881
  readonly website: string | null
package/peas-2.d.ts CHANGED
@@ -116,6 +116,32 @@ module Engine {
116
116
  * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
117
117
  */
118
118
  nonglobal_loaders?: boolean | null
119
+ /**
120
+ * The list of loaded plugins.
121
+ *
122
+ * This will be modified when [method`Engine`.load_plugin] or
123
+ * [method`Engine`.unload_plugin] is called.
124
+ *
125
+ * This can be used with [class`Gio`.Settings] to save the loaded plugins by
126
+ * binding to this property after instantiating the engine by doing:
127
+ *
128
+ * ```c
129
+ * g_settings_bind (gsettings_object,
130
+ * LOADED_PLUGINS_KEY,
131
+ * engine,
132
+ * "loaded-plugins",
133
+ * G_SETTINGS_BIND_DEFAULT);
134
+ * ```
135
+ *
136
+ * Note: notify will not be called when the engine is being destroyed.
137
+ */
138
+ loadedPlugins?: string[] | null
139
+ /**
140
+ * If non-global plugin loaders should be used.
141
+ *
142
+ * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
143
+ */
144
+ nonglobalLoaders?: boolean | null
119
145
  }
120
146
 
121
147
  }
@@ -144,12 +170,38 @@ interface Engine extends Gio.ListModel {
144
170
  * Note: notify will not be called when the engine is being destroyed.
145
171
  */
146
172
  loaded_plugins: string[]
173
+ /**
174
+ * The list of loaded plugins.
175
+ *
176
+ * This will be modified when [method`Engine`.load_plugin] or
177
+ * [method`Engine`.unload_plugin] is called.
178
+ *
179
+ * This can be used with [class`Gio`.Settings] to save the loaded plugins by
180
+ * binding to this property after instantiating the engine by doing:
181
+ *
182
+ * ```c
183
+ * g_settings_bind (gsettings_object,
184
+ * LOADED_PLUGINS_KEY,
185
+ * engine,
186
+ * "loaded-plugins",
187
+ * G_SETTINGS_BIND_DEFAULT);
188
+ * ```
189
+ *
190
+ * Note: notify will not be called when the engine is being destroyed.
191
+ */
192
+ loadedPlugins: string[]
147
193
  /**
148
194
  * If non-global plugin loaders should be used.
149
195
  *
150
196
  * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
151
197
  */
152
198
  readonly nonglobal_loaders: boolean
199
+ /**
200
+ * If non-global plugin loaders should be used.
201
+ *
202
+ * See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
203
+ */
204
+ readonly nonglobalLoaders: boolean
153
205
 
154
206
  // Owm methods of Peas-2.Peas.Engine
155
207
 
@@ -382,6 +434,10 @@ module ExtensionBase {
382
434
  * The [class`PluginInfo]` related to the current plugin.
383
435
  */
384
436
  plugin_info?: PluginInfo | null
437
+ /**
438
+ * The [class`PluginInfo]` related to the current plugin.
439
+ */
440
+ pluginInfo?: PluginInfo | null
385
441
  }
386
442
 
387
443
  }
@@ -398,10 +454,22 @@ interface ExtensionBase {
398
454
  * [method`PluginInfo`.get_data_dir].
399
455
  */
400
456
  readonly data_dir: string | null
457
+ /**
458
+ * The The full path of the directory where the plugin
459
+ * should look for its data files.
460
+ *
461
+ * Note: This is the same path as that returned by
462
+ * [method`PluginInfo`.get_data_dir].
463
+ */
464
+ readonly dataDir: string | null
401
465
  /**
402
466
  * The [class`PluginInfo]` related to the current plugin.
403
467
  */
404
468
  readonly plugin_info: PluginInfo
469
+ /**
470
+ * The [class`PluginInfo]` related to the current plugin.
471
+ */
472
+ readonly pluginInfo: PluginInfo
405
473
 
406
474
  // Own fields of Peas-2.Peas.ExtensionBase
407
475
 
@@ -489,6 +557,8 @@ module ExtensionSet {
489
557
  construct_properties?: any | null
490
558
  engine?: Engine | null
491
559
  extension_type?: GObject.GType | null
560
+ constructProperties?: any | null
561
+ extensionType?: GObject.GType | null
492
562
  }
493
563
 
494
564
  }
@@ -498,8 +568,10 @@ interface ExtensionSet extends Gio.ListModel {
498
568
  // Own properties of Peas-2.Peas.ExtensionSet
499
569
 
500
570
  readonly construct_properties: any
571
+ readonly constructProperties: any
501
572
  readonly engine: Engine
502
573
  readonly extension_type: GObject.GType
574
+ readonly extensionType: GObject.GType
503
575
 
504
576
  // Owm methods of Peas-2.Peas.ExtensionSet
505
577
 
@@ -654,6 +726,11 @@ module ObjectModule {
654
726
  path?: string | null
655
727
  resident?: boolean | null
656
728
  symbol?: string | null
729
+ /**
730
+ * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
731
+ */
732
+ localLinkage?: boolean | null
733
+ moduleName?: string | null
657
734
  }
658
735
 
659
736
  }
@@ -666,7 +743,12 @@ interface ObjectModule extends GObject.TypePlugin {
666
743
  * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
667
744
  */
668
745
  readonly local_linkage: boolean
746
+ /**
747
+ * Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
748
+ */
749
+ readonly localLinkage: boolean
669
750
  readonly module_name: string | null
751
+ readonly moduleName: string | null
670
752
  readonly path: string | null
671
753
  readonly resident: boolean
672
754
  readonly symbol: string | null
@@ -787,11 +869,15 @@ interface PluginInfo {
787
869
  readonly dependencies: string[]
788
870
  readonly description: string | null
789
871
  readonly help_uri: string | null
872
+ readonly helpUri: string | null
790
873
  readonly hidden: boolean
791
874
  readonly icon_name: string | null
875
+ readonly iconName: string | null
792
876
  readonly loaded: boolean
793
877
  readonly module_dir: string | null
878
+ readonly moduleDir: string | null
794
879
  readonly module_name: string | null
880
+ readonly moduleName: string | null
795
881
  readonly name: string | null
796
882
  readonly version: string | null
797
883
  readonly website: string | null