@girs/cmenu-3.0 3.0.0-4.0.0-beta.21 → 3.0.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/cmenu-3.0.d.ts +106 -15
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/cmenu-3.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for CMenu-3.0, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.21.
8
+ GJS TypeScript type definitions for CMenu-3.0, generated from library version 3.0.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/cmenu-3.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 Gio from '@girs/gio-2.0';
12
14
  import type GObject from '@girs/gobject-2.0';
@@ -46,6 +48,9 @@ export namespace CMenu {
46
48
  INCLUDE_UNALLOCATED,
47
49
  }
48
50
  namespace DesktopAppInfo {
51
+ // Signal signatures
52
+ interface SignalSignatures extends GObject.Object.SignalSignatures {}
53
+
49
54
  // Constructor properties interface
50
55
 
51
56
  interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.AppInfo.ConstructorProps {}
@@ -54,6 +59,15 @@ export namespace CMenu {
54
59
  class DesktopAppInfo extends GObject.Object implements Gio.AppInfo {
55
60
  static $gtype: GObject.GType<DesktopAppInfo>;
56
61
 
62
+ /**
63
+ * Compile-time signal type information.
64
+ *
65
+ * This instance property is generated only for TypeScript type checking.
66
+ * It is not defined at runtime and should not be accessed in JS code.
67
+ * @internal
68
+ */
69
+ $signals: DesktopAppInfo.SignalSignatures;
70
+
57
71
  // Constructors
58
72
 
59
73
  constructor(properties?: Partial<DesktopAppInfo.ConstructorProps>, ...args: any[]);
@@ -66,6 +80,24 @@ export namespace CMenu {
66
80
 
67
81
  static new_from_keyfile(key_file: GLib.KeyFile): DesktopAppInfo;
68
82
 
83
+ // Signals
84
+
85
+ connect<K extends keyof DesktopAppInfo.SignalSignatures>(
86
+ signal: K,
87
+ callback: GObject.SignalCallback<this, DesktopAppInfo.SignalSignatures[K]>,
88
+ ): number;
89
+ connect(signal: string, callback: (...args: any[]) => any): number;
90
+ connect_after<K extends keyof DesktopAppInfo.SignalSignatures>(
91
+ signal: K,
92
+ callback: GObject.SignalCallback<this, DesktopAppInfo.SignalSignatures[K]>,
93
+ ): number;
94
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
95
+ emit<K extends keyof DesktopAppInfo.SignalSignatures>(
96
+ signal: K,
97
+ ...args: GObject.GjsParameters<DesktopAppInfo.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
98
+ ): void;
99
+ emit(signal: string, ...args: any[]): void;
100
+
69
101
  // Methods
70
102
 
71
103
  /**
@@ -796,7 +828,21 @@ export namespace CMenu {
796
828
  * @returns the data if found, or %NULL if no such data exists.
797
829
  */
798
830
  get_data(key: string): any | null;
799
- get_property(property_name: string): any;
831
+ /**
832
+ * Gets a property of an object.
833
+ *
834
+ * The value can be:
835
+ * - 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)
836
+ * - a GObject.Value initialized with the expected type of the property
837
+ * - a GObject.Value initialized with a type to which the expected type of the property can be transformed
838
+ *
839
+ * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
840
+ *
841
+ * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
842
+ * @param property_name The name of the property to get
843
+ * @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
844
+ */
845
+ get_property(property_name: string, value: GObject.Value | any): any;
800
846
  /**
801
847
  * This function gets back user data pointers stored via
802
848
  * g_object_set_qdata().
@@ -924,7 +970,12 @@ export namespace CMenu {
924
970
  * @param data data to associate with that key
925
971
  */
926
972
  set_data(key: string, data?: any | null): void;
927
- set_property(property_name: string, value: any): void;
973
+ /**
974
+ * Sets a property on an object.
975
+ * @param property_name The name of the property to set
976
+ * @param value The value to set the property to
977
+ */
978
+ set_property(property_name: string, value: GObject.Value | any): void;
928
979
  /**
929
980
  * Remove a specified datum from the object's data associations,
930
981
  * without invoking the association's destroy handler.
@@ -1074,18 +1125,40 @@ export namespace CMenu {
1074
1125
  * @param pspec
1075
1126
  */
1076
1127
  vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
1128
+ /**
1129
+ * 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.
1130
+ * @param id Handler ID of the handler to be disconnected
1131
+ */
1077
1132
  disconnect(id: number): void;
1133
+ /**
1134
+ * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
1135
+ * @param properties Object containing the properties to set
1136
+ */
1078
1137
  set(properties: { [key: string]: any }): void;
1079
- block_signal_handler(id: number): any;
1080
- unblock_signal_handler(id: number): any;
1081
- stop_emission_by_name(detailedName: string): any;
1138
+ /**
1139
+ * Blocks a handler of an instance so it will not be called during any signal emissions
1140
+ * @param id Handler ID of the handler to be blocked
1141
+ */
1142
+ block_signal_handler(id: number): void;
1143
+ /**
1144
+ * Unblocks a handler so it will be called again during any signal emissions
1145
+ * @param id Handler ID of the handler to be unblocked
1146
+ */
1147
+ unblock_signal_handler(id: number): void;
1148
+ /**
1149
+ * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
1150
+ * @param detailedName Name of the signal to stop emission of
1151
+ */
1152
+ stop_emission_by_name(detailedName: string): void;
1082
1153
  }
1083
1154
 
1084
1155
  namespace Tree {
1085
- // Signal callback interfaces
1086
-
1087
- interface Changed {
1088
- (): void;
1156
+ // Signal signatures
1157
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
1158
+ changed: () => void;
1159
+ 'notify::flags': (pspec: GObject.ParamSpec) => void;
1160
+ 'notify::menu-basename': (pspec: GObject.ParamSpec) => void;
1161
+ 'notify::menu-path': (pspec: GObject.ParamSpec) => void;
1089
1162
  }
1090
1163
 
1091
1164
  // Constructor properties interface
@@ -1131,6 +1204,15 @@ export namespace CMenu {
1131
1204
  */
1132
1205
  get menuPath(): string;
1133
1206
 
1207
+ /**
1208
+ * Compile-time signal type information.
1209
+ *
1210
+ * This instance property is generated only for TypeScript type checking.
1211
+ * It is not defined at runtime and should not be accessed in JS code.
1212
+ * @internal
1213
+ */
1214
+ $signals: Tree.SignalSignatures;
1215
+
1134
1216
  // Constructors
1135
1217
 
1136
1218
  constructor(properties?: Partial<Tree.ConstructorProps>, ...args: any[]);
@@ -1143,12 +1225,21 @@ export namespace CMenu {
1143
1225
 
1144
1226
  // Signals
1145
1227
 
1146
- connect(id: string, callback: (...args: any[]) => any): number;
1147
- connect_after(id: string, callback: (...args: any[]) => any): number;
1148
- emit(id: string, ...args: any[]): void;
1149
- connect(signal: 'changed', callback: (_source: this) => void): number;
1150
- connect_after(signal: 'changed', callback: (_source: this) => void): number;
1151
- emit(signal: 'changed'): void;
1228
+ connect<K extends keyof Tree.SignalSignatures>(
1229
+ signal: K,
1230
+ callback: GObject.SignalCallback<this, Tree.SignalSignatures[K]>,
1231
+ ): number;
1232
+ connect(signal: string, callback: (...args: any[]) => any): number;
1233
+ connect_after<K extends keyof Tree.SignalSignatures>(
1234
+ signal: K,
1235
+ callback: GObject.SignalCallback<this, Tree.SignalSignatures[K]>,
1236
+ ): number;
1237
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
1238
+ emit<K extends keyof Tree.SignalSignatures>(
1239
+ signal: K,
1240
+ ...args: GObject.GjsParameters<Tree.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
1241
+ ): void;
1242
+ emit(signal: string, ...args: any[]): void;
1152
1243
 
1153
1244
  // Static methods
1154
1245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/cmenu-3.0",
3
- "version": "3.0.0-4.0.0-beta.21",
3
+ "version": "3.0.0-4.0.0-beta.24",
4
4
  "description": "GJS TypeScript type definitions for CMenu-3.0, generated from library version 3.0.0",
5
5
  "type": "module",
6
6
  "module": "cmenu-3.0.js",
@@ -31,11 +31,11 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gio-2.0": "^2.83.3-4.0.0-beta.21",
35
- "@girs/gjs": "^4.0.0-beta.21",
36
- "@girs/glib-2.0": "^2.83.3-4.0.0-beta.21",
37
- "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.21",
38
- "@girs/gobject-2.0": "^2.83.3-4.0.0-beta.21"
34
+ "@girs/gio-2.0": "^2.84.2-4.0.0-beta.24",
35
+ "@girs/gjs": "^4.0.0-beta.24",
36
+ "@girs/glib-2.0": "^2.84.2-4.0.0-beta.24",
37
+ "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.24",
38
+ "@girs/gobject-2.0": "^2.84.2-4.0.0-beta.24"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "*"