@girs/gplugin-1.0 0.44.0-4.0.0-beta.21 → 0.44.0-4.0.0-beta.24

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/gplugin-1.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GPlugin-1.0, generated from library version 0.44.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.21.
8
+ GJS TypeScript type definitions for GPlugin-1.0, generated from library version 0.44.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.24.
9
9
 
10
10
 
11
11
  ## Install
package/gplugin-1.0.d.ts CHANGED
@@ -7,6 +7,8 @@
7
7
  * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
8
  */
9
9
 
10
+ import '@girs/gjs';
11
+
10
12
  // Module dependencies
11
13
  import type GObject from '@girs/gobject-2.0';
12
14
  import type GLib from '@girs/glib-2.0';
@@ -189,6 +191,11 @@ export namespace GPlugin {
189
191
  LOG_PLUGIN_STATE_CHANGES,
190
192
  }
191
193
  namespace FileSource {
194
+ // Signal signatures
195
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
196
+ 'notify::manager': (pspec: GObject.ParamSpec) => void;
197
+ }
198
+
192
199
  // Constructor properties interface
193
200
 
194
201
  interface ConstructorProps extends GObject.Object.ConstructorProps, Source.ConstructorProps {
@@ -209,12 +216,39 @@ export namespace GPlugin {
209
216
  */
210
217
  get manager(): Manager;
211
218
 
219
+ /**
220
+ * Compile-time signal type information.
221
+ *
222
+ * This instance property is generated only for TypeScript type checking.
223
+ * It is not defined at runtime and should not be accessed in JS code.
224
+ * @internal
225
+ */
226
+ $signals: FileSource.SignalSignatures;
227
+
212
228
  // Constructors
213
229
 
214
230
  constructor(properties?: Partial<FileSource.ConstructorProps>, ...args: any[]);
215
231
 
216
232
  _init(...args: any[]): void;
217
233
 
234
+ // Signals
235
+
236
+ connect<K extends keyof FileSource.SignalSignatures>(
237
+ signal: K,
238
+ callback: GObject.SignalCallback<this, FileSource.SignalSignatures[K]>,
239
+ ): number;
240
+ connect(signal: string, callback: (...args: any[]) => any): number;
241
+ connect_after<K extends keyof FileSource.SignalSignatures>(
242
+ signal: K,
243
+ callback: GObject.SignalCallback<this, FileSource.SignalSignatures[K]>,
244
+ ): number;
245
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
246
+ emit<K extends keyof FileSource.SignalSignatures>(
247
+ signal: K,
248
+ ...args: GObject.GjsParameters<FileSource.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
249
+ ): void;
250
+ emit(signal: string, ...args: any[]): void;
251
+
218
252
  // Static methods
219
253
 
220
254
  /**
@@ -361,7 +395,21 @@ export namespace GPlugin {
361
395
  * @returns the data if found, or %NULL if no such data exists.
362
396
  */
363
397
  get_data(key: string): any | null;
364
- get_property(property_name: string): any;
398
+ /**
399
+ * Gets a property of an object.
400
+ *
401
+ * The value can be:
402
+ * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
403
+ * - a GObject.Value initialized with the expected type of the property
404
+ * - a GObject.Value initialized with a type to which the expected type of the property can be transformed
405
+ *
406
+ * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
407
+ *
408
+ * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
409
+ * @param property_name The name of the property to get
410
+ * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
411
+ */
412
+ get_property(property_name: string, value: GObject.Value | any): any;
365
413
  /**
366
414
  * This function gets back user data pointers stored via
367
415
  * g_object_set_qdata().
@@ -489,7 +537,12 @@ export namespace GPlugin {
489
537
  * @param data data to associate with that key
490
538
  */
491
539
  set_data(key: string, data?: any | null): void;
492
- set_property(property_name: string, value: any): void;
540
+ /**
541
+ * Sets a property on an object.
542
+ * @param property_name The name of the property to set
543
+ * @param value The value to set the property to
544
+ */
545
+ set_property(property_name: string, value: GObject.Value | any): void;
493
546
  /**
494
547
  * Remove a specified datum from the object's data associations,
495
548
  * without invoking the association's destroy handler.
@@ -639,14 +692,39 @@ export namespace GPlugin {
639
692
  * @param pspec
640
693
  */
641
694
  vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
695
+ /**
696
+ * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
697
+ * @param id Handler ID of the handler to be disconnected
698
+ */
642
699
  disconnect(id: number): void;
700
+ /**
701
+ * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
702
+ * @param properties Object containing the properties to set
703
+ */
643
704
  set(properties: { [key: string]: any }): void;
644
- block_signal_handler(id: number): any;
645
- unblock_signal_handler(id: number): any;
646
- stop_emission_by_name(detailedName: string): any;
705
+ /**
706
+ * Blocks a handler of an instance so it will not be called during any signal emissions
707
+ * @param id Handler ID of the handler to be blocked
708
+ */
709
+ block_signal_handler(id: number): void;
710
+ /**
711
+ * Unblocks a handler so it will be called again during any signal emissions
712
+ * @param id Handler ID of the handler to be unblocked
713
+ */
714
+ unblock_signal_handler(id: number): void;
715
+ /**
716
+ * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
717
+ * @param detailedName Name of the signal to stop emission of
718
+ */
719
+ stop_emission_by_name(detailedName: string): void;
647
720
  }
648
721
 
649
722
  namespace Loader {
723
+ // Signal signatures
724
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
725
+ 'notify::id': (pspec: GObject.ParamSpec) => void;
726
+ }
727
+
650
728
  // Constructor properties interface
651
729
 
652
730
  interface ConstructorProps extends GObject.Object.ConstructorProps {
@@ -667,12 +745,39 @@ export namespace GPlugin {
667
745
  */
668
746
  get id(): string;
669
747
 
748
+ /**
749
+ * Compile-time signal type information.
750
+ *
751
+ * This instance property is generated only for TypeScript type checking.
752
+ * It is not defined at runtime and should not be accessed in JS code.
753
+ * @internal
754
+ */
755
+ $signals: Loader.SignalSignatures;
756
+
670
757
  // Constructors
671
758
 
672
759
  constructor(properties?: Partial<Loader.ConstructorProps>, ...args: any[]);
673
760
 
674
761
  _init(...args: any[]): void;
675
762
 
763
+ // Signals
764
+
765
+ connect<K extends keyof Loader.SignalSignatures>(
766
+ signal: K,
767
+ callback: GObject.SignalCallback<this, Loader.SignalSignatures[K]>,
768
+ ): number;
769
+ connect(signal: string, callback: (...args: any[]) => any): number;
770
+ connect_after<K extends keyof Loader.SignalSignatures>(
771
+ signal: K,
772
+ callback: GObject.SignalCallback<this, Loader.SignalSignatures[K]>,
773
+ ): number;
774
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
775
+ emit<K extends keyof Loader.SignalSignatures>(
776
+ signal: K,
777
+ ...args: GObject.GjsParameters<Loader.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
778
+ ): void;
779
+ emit(signal: string, ...args: any[]): void;
780
+
676
781
  // Virtual methods
677
782
 
678
783
  /**
@@ -728,38 +833,16 @@ export namespace GPlugin {
728
833
  }
729
834
 
730
835
  namespace Manager {
731
- // Signal callback interfaces
732
-
733
- interface LoadPluginFailed {
734
- (plugin: GObject.Object, error: GLib.Error): void;
735
- }
736
-
737
- interface LoadedPlugin {
738
- (plugin: GObject.Object): void;
739
- }
740
-
741
- interface LoaderRegistered {
742
- (loader: Loader): void;
743
- }
744
-
745
- interface LoaderUnregistered {
746
- (loader: Loader): void;
747
- }
748
-
749
- interface LoadingPlugin {
750
- (plugin: GObject.Object, error?: any | null): boolean;
751
- }
752
-
753
- interface UnloadPluginFailed {
754
- (plugin: GObject.Object, error: GLib.Error): void;
755
- }
756
-
757
- interface UnloadedPlugin {
758
- (plugin: GObject.Object): void;
759
- }
760
-
761
- interface UnloadingPlugin {
762
- (plugin: GObject.Object, error?: any | null): boolean;
836
+ // Signal signatures
837
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
838
+ 'load-plugin-failed': (arg0: GObject.Object, arg1: GLib.Error) => void;
839
+ 'loaded-plugin': (arg0: GObject.Object) => void;
840
+ 'loader-registered': (arg0: Loader) => void;
841
+ 'loader-unregistered': (arg0: Loader) => void;
842
+ 'loading-plugin': (arg0: GObject.Object, arg1: any | null) => boolean | void;
843
+ 'unload-plugin-failed': (arg0: GObject.Object, arg1: GLib.Error) => void;
844
+ 'unloaded-plugin': (arg0: GObject.Object) => void;
845
+ 'unloading-plugin': (arg0: GObject.Object, arg1: any | null) => boolean | void;
763
846
  }
764
847
 
765
848
  // Constructor properties interface
@@ -775,6 +858,15 @@ export namespace GPlugin {
775
858
  class Manager extends GObject.Object {
776
859
  static $gtype: GObject.GType<Manager>;
777
860
 
861
+ /**
862
+ * Compile-time signal type information.
863
+ *
864
+ * This instance property is generated only for TypeScript type checking.
865
+ * It is not defined at runtime and should not be accessed in JS code.
866
+ * @internal
867
+ */
868
+ $signals: Manager.SignalSignatures;
869
+
778
870
  // Constructors
779
871
 
780
872
  constructor(properties?: Partial<Manager.ConstructorProps>, ...args: any[]);
@@ -783,57 +875,21 @@ export namespace GPlugin {
783
875
 
784
876
  // Signals
785
877
 
786
- connect(id: string, callback: (...args: any[]) => any): number;
787
- connect_after(id: string, callback: (...args: any[]) => any): number;
788
- emit(id: string, ...args: any[]): void;
789
- connect(
790
- signal: 'load-plugin-failed',
791
- callback: (_source: this, plugin: GObject.Object, error: GLib.Error) => void,
792
- ): number;
793
- connect_after(
794
- signal: 'load-plugin-failed',
795
- callback: (_source: this, plugin: GObject.Object, error: GLib.Error) => void,
796
- ): number;
797
- emit(signal: 'load-plugin-failed', plugin: GObject.Object, error: GLib.Error): void;
798
- connect(signal: 'loaded-plugin', callback: (_source: this, plugin: GObject.Object) => void): number;
799
- connect_after(signal: 'loaded-plugin', callback: (_source: this, plugin: GObject.Object) => void): number;
800
- emit(signal: 'loaded-plugin', plugin: GObject.Object): void;
801
- connect(signal: 'loader-registered', callback: (_source: this, loader: Loader) => void): number;
802
- connect_after(signal: 'loader-registered', callback: (_source: this, loader: Loader) => void): number;
803
- emit(signal: 'loader-registered', loader: Loader): void;
804
- connect(signal: 'loader-unregistered', callback: (_source: this, loader: Loader) => void): number;
805
- connect_after(signal: 'loader-unregistered', callback: (_source: this, loader: Loader) => void): number;
806
- emit(signal: 'loader-unregistered', loader: Loader): void;
807
- connect(
808
- signal: 'loading-plugin',
809
- callback: (_source: this, plugin: GObject.Object, error: any | null) => boolean,
810
- ): number;
811
- connect_after(
812
- signal: 'loading-plugin',
813
- callback: (_source: this, plugin: GObject.Object, error: any | null) => boolean,
878
+ connect<K extends keyof Manager.SignalSignatures>(
879
+ signal: K,
880
+ callback: GObject.SignalCallback<this, Manager.SignalSignatures[K]>,
814
881
  ): number;
815
- emit(signal: 'loading-plugin', plugin: GObject.Object, error?: any | null): void;
816
- connect(
817
- signal: 'unload-plugin-failed',
818
- callback: (_source: this, plugin: GObject.Object, error: GLib.Error) => void,
882
+ connect(signal: string, callback: (...args: any[]) => any): number;
883
+ connect_after<K extends keyof Manager.SignalSignatures>(
884
+ signal: K,
885
+ callback: GObject.SignalCallback<this, Manager.SignalSignatures[K]>,
819
886
  ): number;
820
- connect_after(
821
- signal: 'unload-plugin-failed',
822
- callback: (_source: this, plugin: GObject.Object, error: GLib.Error) => void,
823
- ): number;
824
- emit(signal: 'unload-plugin-failed', plugin: GObject.Object, error: GLib.Error): void;
825
- connect(signal: 'unloaded-plugin', callback: (_source: this, plugin: GObject.Object) => void): number;
826
- connect_after(signal: 'unloaded-plugin', callback: (_source: this, plugin: GObject.Object) => void): number;
827
- emit(signal: 'unloaded-plugin', plugin: GObject.Object): void;
828
- connect(
829
- signal: 'unloading-plugin',
830
- callback: (_source: this, plugin: GObject.Object, error: any | null) => boolean,
831
- ): number;
832
- connect_after(
833
- signal: 'unloading-plugin',
834
- callback: (_source: this, plugin: GObject.Object, error: any | null) => boolean,
835
- ): number;
836
- emit(signal: 'unloading-plugin', plugin: GObject.Object, error?: any | null): void;
887
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
888
+ emit<K extends keyof Manager.SignalSignatures>(
889
+ signal: K,
890
+ ...args: GObject.GjsParameters<Manager.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
891
+ ): void;
892
+ emit(signal: string, ...args: any[]): void;
837
893
 
838
894
  // Static methods
839
895
 
@@ -1004,6 +1060,33 @@ export namespace GPlugin {
1004
1060
  }
1005
1061
 
1006
1062
  namespace PluginInfo {
1063
+ // Signal signatures
1064
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
1065
+ 'notify::abi-version': (pspec: GObject.ParamSpec) => void;
1066
+ 'notify::authors': (pspec: GObject.ParamSpec) => void;
1067
+ 'notify::auto-load': (pspec: GObject.ParamSpec) => void;
1068
+ 'notify::bind-global': (pspec: GObject.ParamSpec) => void;
1069
+ 'notify::category': (pspec: GObject.ParamSpec) => void;
1070
+ 'notify::dependencies': (pspec: GObject.ParamSpec) => void;
1071
+ 'notify::description': (pspec: GObject.ParamSpec) => void;
1072
+ 'notify::discriminator': (pspec: GObject.ParamSpec) => void;
1073
+ 'notify::icon-name': (pspec: GObject.ParamSpec) => void;
1074
+ 'notify::id': (pspec: GObject.ParamSpec) => void;
1075
+ 'notify::internal': (pspec: GObject.ParamSpec) => void;
1076
+ 'notify::license-id': (pspec: GObject.ParamSpec) => void;
1077
+ 'notify::license-text': (pspec: GObject.ParamSpec) => void;
1078
+ 'notify::license-url': (pspec: GObject.ParamSpec) => void;
1079
+ 'notify::load-on-query': (pspec: GObject.ParamSpec) => void;
1080
+ 'notify::name': (pspec: GObject.ParamSpec) => void;
1081
+ 'notify::priority': (pspec: GObject.ParamSpec) => void;
1082
+ 'notify::provides': (pspec: GObject.ParamSpec) => void;
1083
+ 'notify::settings-schema': (pspec: GObject.ParamSpec) => void;
1084
+ 'notify::summary': (pspec: GObject.ParamSpec) => void;
1085
+ 'notify::unloadable': (pspec: GObject.ParamSpec) => void;
1086
+ 'notify::version': (pspec: GObject.ParamSpec) => void;
1087
+ 'notify::website': (pspec: GObject.ParamSpec) => void;
1088
+ }
1089
+
1007
1090
  // Constructor properties interface
1008
1091
 
1009
1092
  interface ConstructorProps extends GObject.Object.ConstructorProps {
@@ -1289,12 +1372,39 @@ export namespace GPlugin {
1289
1372
  */
1290
1373
  get website(): string;
1291
1374
 
1375
+ /**
1376
+ * Compile-time signal type information.
1377
+ *
1378
+ * This instance property is generated only for TypeScript type checking.
1379
+ * It is not defined at runtime and should not be accessed in JS code.
1380
+ * @internal
1381
+ */
1382
+ $signals: PluginInfo.SignalSignatures;
1383
+
1292
1384
  // Constructors
1293
1385
 
1294
1386
  constructor(properties?: Partial<PluginInfo.ConstructorProps>, ...args: any[]);
1295
1387
 
1296
1388
  _init(...args: any[]): void;
1297
1389
 
1390
+ // Signals
1391
+
1392
+ connect<K extends keyof PluginInfo.SignalSignatures>(
1393
+ signal: K,
1394
+ callback: GObject.SignalCallback<this, PluginInfo.SignalSignatures[K]>,
1395
+ ): number;
1396
+ connect(signal: string, callback: (...args: any[]) => any): number;
1397
+ connect_after<K extends keyof PluginInfo.SignalSignatures>(
1398
+ signal: K,
1399
+ callback: GObject.SignalCallback<this, PluginInfo.SignalSignatures[K]>,
1400
+ ): number;
1401
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
1402
+ emit<K extends keyof PluginInfo.SignalSignatures>(
1403
+ signal: K,
1404
+ ...args: GObject.GjsParameters<PluginInfo.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
1405
+ ): void;
1406
+ emit(signal: string, ...args: any[]): void;
1407
+
1298
1408
  // Methods
1299
1409
 
1300
1410
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gplugin-1.0",
3
- "version": "0.44.0-4.0.0-beta.21",
3
+ "version": "0.44.0-4.0.0-beta.24",
4
4
  "description": "GJS TypeScript type definitions for GPlugin-1.0, generated from library version 0.44.0",
5
5
  "type": "module",
6
6
  "module": "gplugin-1.0.js",
@@ -31,9 +31,9 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.0.0-beta.21",
35
- "@girs/glib-2.0": "^2.83.3-4.0.0-beta.21",
36
- "@girs/gobject-2.0": "^2.83.3-4.0.0-beta.21"
34
+ "@girs/gjs": "^4.0.0-beta.24",
35
+ "@girs/glib-2.0": "^2.84.2-4.0.0-beta.24",
36
+ "@girs/gobject-2.0": "^2.84.2-4.0.0-beta.24"
37
37
  },
38
38
  "devDependencies": {
39
39
  "typescript": "*"