@girs/gobject-2.0 2.80.3-4.0.0-beta.6 → 2.80.3-4.0.0-beta.11

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/gobject-2.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GObject-2.0, generated from library version 2.80.3 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.6.
8
+ GJS TypeScript type definitions for GObject-2.0, generated from library version 2.80.3 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.11.
9
9
 
10
10
 
11
11
  ## Install
@@ -1,12 +1,9 @@
1
-
2
1
  declare module 'gi://GObject?version=2.0' {
3
- import GObject from '@girs/gobject-2.0';
4
- export default GObject;
2
+ import GObject20 from '@girs/gobject-2.0';
3
+ export default GObject20;
5
4
  }
6
5
 
7
6
  declare module 'gi://GObject' {
8
7
  import GObject20 from 'gi://GObject?version=2.0';
9
8
  export default GObject20;
10
9
  }
11
-
12
-
@@ -1,4 +1,3 @@
1
-
2
1
  import GObject20 from '@girs/gobject-2.0';
3
2
 
4
3
  declare global {
@@ -8,5 +7,3 @@ declare global {
8
7
  }
9
8
 
10
9
  export default GjsGiImports;
11
-
12
-
package/gobject-2.0.d.ts CHANGED
@@ -1,19 +1,255 @@
1
- /*
1
+ /**
2
2
  * Type Definitions for Gjs (https://gjs.guide/)
3
3
  *
4
4
  * These type definitions are automatically generated, do not edit them by hand.
5
5
  * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
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, ...
6
8
  */
7
9
 
8
- import './gobject-2.0-ambient.d.ts';
9
-
10
- /**
11
- * GObject-2.0
12
- */
13
-
10
+ // Module dependencies
14
11
  import type GLib from '@girs/glib-2.0';
15
12
 
16
13
  export namespace GObject {
14
+ // A few things here are inspired by gi.ts
15
+ // See https://gitlab.gnome.org/ewlsh/gi.ts/-/blob/master/packages/lib/src/generators/dts/gobject.ts
16
+ // Copyright Evan Welsh
17
+
18
+ // __type__ forces all GTypes to not match structurally.
19
+ export type GType<T = unknown> = {
20
+ __type__(arg: never): T;
21
+ name: string;
22
+ };
23
+
24
+ // Extra interfaces used to help define GObject classes in js; these
25
+ // aren't part of gi.
26
+ export interface SignalDefinition {
27
+ flags?: SignalFlags;
28
+ accumulator: number;
29
+ return_type?: GType;
30
+ param_types?: GType[];
31
+ }
32
+
33
+ export interface MetaInfo<Props, Interfaces, Sigs> {
34
+ GTypeName?: string;
35
+ GTypeFlags?: TypeFlags;
36
+ Properties?: Props;
37
+ Signals?: Sigs;
38
+ Implements?: Interfaces;
39
+ CssName?: string;
40
+ Template?: Uint8Array | GLib.Bytes | string;
41
+ Children?: string[];
42
+ InternalChildren?: string[];
43
+ }
44
+
45
+ // Correctly types interface checks.
46
+ export function type_is_a<T extends Object>(obj: Object, is_a_type: { $gtype: GType<T> }): obj is T;
47
+
48
+ export class Interface<T = unknown> {
49
+ static _classInit: (cls: any) => any;
50
+ __name__: string;
51
+ _construct: (params: any, ...otherArgs: any[]) => any;
52
+ _init: (params: any) => void;
53
+ $gtype?: GType<T>;
54
+ }
55
+
56
+ /**
57
+ * Use this to signify a function that must be overridden in an
58
+ * implementation of the interface.
59
+ */
60
+ export class NotImplementedError extends Error {
61
+ get name(): 'NotImplementedError';
62
+ }
63
+
64
+ export const __gtkCssName__: unique symbol;
65
+ export const __gtkTemplate__: unique symbol;
66
+ export const __gtkChildren__: unique symbol;
67
+ export const __gtkInternalChildren__: unique symbol;
68
+
69
+ // Expose GObject static properties for ES6 classes
70
+
71
+ export const GTypeName: unique symbol;
72
+ export const requires: unique symbol;
73
+ export const interfaces: unique symbol;
74
+ export const properties: unique symbol;
75
+ export const signals: unique symbol;
76
+
77
+ export let gtypeNameBasedOnJSPath: boolean;
78
+
79
+ export let TYPE_BOOLEAN: GType<boolean>;
80
+ export let Boolean: BooleanConstructor;
81
+
82
+ export let TYPE_ENUM: GType<number>;
83
+ export let TYPE_FLAGS: GType<number>;
84
+
85
+ export let TYPE_DOUBLE: GType<number>;
86
+ export let Double: NumberConstructor;
87
+
88
+ export let TYPE_STRING: GType<string>;
89
+ export let String: StringConstructor;
90
+
91
+ export let TYPE_NONE: GType<undefined>;
92
+ export let TYPE_POINTER: GType<undefined>;
93
+ export let TYPE_BOXED: GType<unknown>;
94
+ export let TYPE_PARAM: GType<unknown>;
95
+ export let TYPE_INTERFACE: GType<unknown>;
96
+ export let TYPE_OBJECT: GType<object>;
97
+ export let TYPE_VARIANT: GType<GLib.Variant>;
98
+ export let TYPE_INT: GType<number>;
99
+ export let TYPE_UINT: GType<number>;
100
+ export let TYPE_INT64: GType<number>;
101
+ export let TYPE_UINT64: GType<number>;
102
+
103
+ // fake enum for signal accumulators, keep in sync with gi/object.c
104
+ export enum AccumulatorType {
105
+ NONE = 0,
106
+ FIRST_WINS = 1,
107
+ TRUE_HANDLED = 2,
108
+ }
109
+
110
+ // A simple workaround if you have a class with .connect, .disconnect or .emit
111
+ // methods (such as Gio.Socket.connect or NMClient.Device.disconnect)
112
+ // The original g_signal_* functions are not introspectable anyway, because
113
+ // we need our own handling of signal argument marshalling
114
+ export function signal_connect(object: Object, name: string, handler: (...args: any[]) => any): number;
115
+ export function signal_connect_after(object: Object, name: string, handler: (...args: any[]) => any): number;
116
+ export function signal_emit_by_name(object: Object, name: string, ...args: any[]): void;
117
+
118
+ /**
119
+ * Finds the first signal handler that matches certain selection criteria.
120
+ * The criteria are passed as properties of a match object.
121
+ * The match object has to be non-empty for successful matches.
122
+ * If no handler was found, a falsy value is returned.
123
+ *
124
+ * @param instance the instance owning the signal handler to be found.
125
+ * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
126
+ * @param match.signalId signal the handler has to be connected to.
127
+ * @param match.detail signal detail the handler has to be connected to.
128
+ * @param match.func the callback function the handler will invoke.
129
+ * @returns A valid non-0 signal handler ID for a successful match.
130
+ */
131
+ export function signal_handler_find(
132
+ instance: Object,
133
+ match: { signalId: string; detail: string; func: (...args: any[]) => any },
134
+ ): number | bigint | object | null;
135
+
136
+ /**
137
+ * Blocks all handlers on an instance that match certain selection criteria.
138
+ * The criteria are passed as properties of a match object.
139
+ * The match object has to have at least `func` for successful matches.
140
+ * If no handlers were found, 0 is returned, the number of blocked handlers
141
+ * otherwise.
142
+ *
143
+ * @param instance the instance owning the signal handler to be found.
144
+ * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
145
+ * @param match.signalId signal the handler has to be connected to.
146
+ * @param match.detail signal detail the handler has to be connected to.
147
+ * @param match.func the callback function the handler will invoke.
148
+ * @returns The number of handlers that matched.
149
+ */
150
+ export function signal_handlers_block_matched(
151
+ instance: Object,
152
+ match: { signalId: string; detail: string; func: (...args: any[]) => any },
153
+ ): number;
154
+
155
+ /**
156
+ * Disconnects all handlers on an instance that match certain selection
157
+ * criteria.
158
+ * The criteria are passed as properties of a match object.
159
+ * The match object has to have at least `func` for successful matches.
160
+ * If no handlers were found, 0 is returned, the number of disconnected
161
+ * handlers otherwise.
162
+ *
163
+ * @param instance the instance owning the signal handler
164
+ * to be found.
165
+ * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
166
+ * @param match.signalId signal the handler has to be connected to.
167
+ * @param match.detail signal detail the handler has to be connected to.
168
+ * @param match.func the callback function the handler will invoke.
169
+ * @returns The number of handlers that matched.
170
+ */
171
+ export function signal_handlers_unblock_matched(
172
+ instance: Object,
173
+ match: { signalId: string; detail: string; func: (...args: any[]) => any },
174
+ ): number;
175
+
176
+ /**
177
+ * Disconnects all handlers on an instance that match certain selection
178
+ * criteria.
179
+ * The criteria are passed as properties of a match object.
180
+ * The match object has to have at least `func` for successful matches.
181
+ * If no handlers were found, 0 is returned, the number of disconnected
182
+ * handlers otherwise.
183
+ *
184
+ * @param instance the instance owning the signal handler
185
+ * to be found.
186
+ * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
187
+ * @param match.signalId signal the handler has to be connected to.
188
+ * @param match.detail signal detail the handler has to be connected to.
189
+ * @param match.func the callback function the handler will invoke.
190
+ * @returns The number of handlers that matched.
191
+ */
192
+ export function signal_handlers_disconnect_matched(
193
+ instance: Object,
194
+ match: { signalId: string; detail: string; func: (...args: any[]) => any },
195
+ ): number;
196
+
197
+ // Also match the macros used in C APIs, even though they're not introspected
198
+
199
+ /**
200
+ * Blocks all handlers on an instance that match `func`.
201
+ *
202
+ * @param instance the instance to block handlers from.
203
+ * @param func the callback function the handler will invoke.
204
+ * @returns The number of handlers that matched.
205
+ */
206
+ export function signal_handlers_block_by_func(instance: Object, func: (...args: any[]) => any): number;
207
+
208
+ /**
209
+ * Unblocks all handlers on an instance that match `func`.
210
+ *
211
+ * @function
212
+ * @param instance the instance to unblock handlers from.
213
+ * @param func the callback function the handler will invoke.
214
+ * @returns The number of handlers that matched.
215
+ */
216
+ export function signal_handlers_unblock_by_func(instance: Object, func: (...args: any[]) => any): number;
217
+
218
+ /**
219
+ * Disconnects all handlers on an instance that match `func`.
220
+ *
221
+ * @param instance the instance to remove handlers from.
222
+ * @param func the callback function the handler will invoke.
223
+ * @returns The number of handlers that matched.
224
+ */
225
+ export function signal_handlers_disconnect_by_func(instance: Object, func: (...args: any[]) => any): number;
226
+ export function signal_handlers_disconnect_by_data(): void;
227
+
228
+ export type Property<K extends ParamSpec> = K extends ParamSpec<infer T> ? T : any;
229
+
230
+ // TODO: What about the generated class Closure
231
+ export type TClosure<R = any, P = any> = (...args: P[]) => R;
232
+
233
+ type ObjectConstructor = { new (...args: any[]): Object };
234
+
235
+ export function registerClass<
236
+ T extends ObjectConstructor,
237
+ Props extends { [key: string]: ParamSpec },
238
+ Interfaces extends { $gtype: GType }[],
239
+ Sigs extends {
240
+ [key: string]: {
241
+ param_types?: readonly GType[];
242
+ [key: string]: any;
243
+ };
244
+ },
245
+ >(options: MetaInfo<Props, Interfaces, Sigs>, cls: T): T;
246
+
247
+ export function registerClass<T extends ObjectConstructor>(cls: T): T;
248
+
249
+ /**
250
+ * GObject-2.0
251
+ */
252
+
17
253
  /**
18
254
  * Mask containing the bits of #GParamSpec.flags which are reserved for GLib.
19
255
  */
@@ -2269,6 +2505,17 @@ export namespace GObject {
2269
2505
  *
2270
2506
  * This enumeration can be extended at later date.
2271
2507
  */
2508
+
2509
+ /**
2510
+ * Flags to be passed to g_object_bind_property() or
2511
+ * g_object_bind_property_full().
2512
+ *
2513
+ * This enumeration can be extended at later date.
2514
+ */
2515
+ export namespace BindingFlags {
2516
+ export const $gtype: GType<BindingFlags>;
2517
+ }
2518
+
2272
2519
  enum BindingFlags {
2273
2520
  /**
2274
2521
  * The default binding; if the source property
@@ -2300,6 +2547,15 @@ export namespace GObject {
2300
2547
  * The connection flags are used to specify the behaviour of a signal's
2301
2548
  * connection.
2302
2549
  */
2550
+
2551
+ /**
2552
+ * The connection flags are used to specify the behaviour of a signal's
2553
+ * connection.
2554
+ */
2555
+ export namespace ConnectFlags {
2556
+ export const $gtype: GType<ConnectFlags>;
2557
+ }
2558
+
2303
2559
  enum ConnectFlags {
2304
2560
  /**
2305
2561
  * Default behaviour (no special flags). Since: 2.74
@@ -2317,6 +2573,11 @@ export namespace GObject {
2317
2573
  */
2318
2574
  SWAPPED,
2319
2575
  }
2576
+
2577
+ export namespace IOCondition {
2578
+ export const $gtype: GType<IOCondition>;
2579
+ }
2580
+
2320
2581
  enum IOCondition {
2321
2582
  IN,
2322
2583
  OUT,
@@ -2331,6 +2592,17 @@ export namespace GObject {
2331
2592
  *
2332
2593
  * See also: %G_PARAM_STATIC_STRINGS
2333
2594
  */
2595
+
2596
+ /**
2597
+ * Through the #GParamFlags flag values, certain aspects of parameters
2598
+ * can be configured.
2599
+ *
2600
+ * See also: %G_PARAM_STATIC_STRINGS
2601
+ */
2602
+ export namespace ParamFlags {
2603
+ export const $gtype: GType<ParamFlags>;
2604
+ }
2605
+
2334
2606
  enum ParamFlags {
2335
2607
  /**
2336
2608
  * the parameter is readable
@@ -2400,6 +2672,14 @@ export namespace GObject {
2400
2672
  /**
2401
2673
  * The signal flags are used to specify a signal's behaviour.
2402
2674
  */
2675
+
2676
+ /**
2677
+ * The signal flags are used to specify a signal's behaviour.
2678
+ */
2679
+ export namespace SignalFlags {
2680
+ export const $gtype: GType<SignalFlags>;
2681
+ }
2682
+
2403
2683
  enum SignalFlags {
2404
2684
  /**
2405
2685
  * Invoke the object method handler in the first emission stage.
@@ -2460,6 +2740,16 @@ export namespace GObject {
2460
2740
  * g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
2461
2741
  * match signals by.
2462
2742
  */
2743
+
2744
+ /**
2745
+ * The match types specify what g_signal_handlers_block_matched(),
2746
+ * g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched()
2747
+ * match signals by.
2748
+ */
2749
+ export namespace SignalMatchType {
2750
+ export const $gtype: GType<SignalMatchType>;
2751
+ }
2752
+
2463
2753
  enum SignalMatchType {
2464
2754
  /**
2465
2755
  * The signal id must be equal.
@@ -2493,6 +2783,18 @@ export namespace GObject {
2493
2783
  * If you need to enable debugging features, use the `GOBJECT_DEBUG`
2494
2784
  * environment variable.
2495
2785
  */
2786
+
2787
+ /**
2788
+ * These flags used to be passed to g_type_init_with_debug_flags() which
2789
+ * is now deprecated.
2790
+ *
2791
+ * If you need to enable debugging features, use the `GOBJECT_DEBUG`
2792
+ * environment variable.
2793
+ */
2794
+ export namespace TypeDebugFlags {
2795
+ export const $gtype: GType<TypeDebugFlags>;
2796
+ }
2797
+
2496
2798
  enum TypeDebugFlags {
2497
2799
  /**
2498
2800
  * Print no messages
@@ -2518,6 +2820,14 @@ export namespace GObject {
2518
2820
  /**
2519
2821
  * Bit masks used to check or determine characteristics of a type.
2520
2822
  */
2823
+
2824
+ /**
2825
+ * Bit masks used to check or determine characteristics of a type.
2826
+ */
2827
+ export namespace TypeFlags {
2828
+ export const $gtype: GType<TypeFlags>;
2829
+ }
2830
+
2521
2831
  enum TypeFlags {
2522
2832
  /**
2523
2833
  * No special flags. Since: 2.74
@@ -2550,6 +2860,15 @@ export namespace GObject {
2550
2860
  * Bit masks used to check or determine specific characteristics of a
2551
2861
  * fundamental type.
2552
2862
  */
2863
+
2864
+ /**
2865
+ * Bit masks used to check or determine specific characteristics of a
2866
+ * fundamental type.
2867
+ */
2868
+ export namespace TypeFundamentalFlags {
2869
+ export const $gtype: GType<TypeFundamentalFlags>;
2870
+ }
2871
+
2553
2872
  enum TypeFundamentalFlags {
2554
2873
  /**
2555
2874
  * Indicates a classed type
@@ -6286,241 +6605,6 @@ export namespace GObject {
6286
6605
  func: object | null,
6287
6606
  object: object | null,
6288
6607
  ): number;
6289
- // A few things here are inspired by gi.ts
6290
- // See https://gitlab.gnome.org/ewlsh/gi.ts/-/blob/master/packages/lib/src/generators/dts/gobject.ts
6291
- // Copyright Evan Welsh
6292
-
6293
- // __type__ forces all GTypes to not match structurally.
6294
- export type GType<T = unknown> = {
6295
- __type__(arg: never): T;
6296
- name: string;
6297
- };
6298
-
6299
- // Extra interfaces used to help define GObject classes in js; these
6300
- // aren't part of gi.
6301
- export interface SignalDefinition {
6302
- flags?: SignalFlags;
6303
- accumulator: number;
6304
- return_type?: GType;
6305
- param_types?: GType[];
6306
- }
6307
-
6308
- export interface MetaInfo<Props, Interfaces, Sigs> {
6309
- GTypeName?: string;
6310
- GTypeFlags?: TypeFlags;
6311
- Properties?: Props;
6312
- Signals?: Sigs;
6313
- Implements?: Interfaces;
6314
- CssName?: string;
6315
- Template?: Uint8Array | GLib.Bytes | string;
6316
- Children?: string[];
6317
- InternalChildren?: string[];
6318
- }
6319
-
6320
- // Correctly types interface checks.
6321
- export function type_is_a<T extends Object>(obj: Object, is_a_type: { $gtype: GType<T> }): obj is T;
6322
-
6323
- export class Interface<T = unknown> {
6324
- static _classInit: (cls: any) => any;
6325
- __name__: string;
6326
- _construct: (params: any, ...otherArgs: any[]) => any;
6327
- _init: (params: any) => void;
6328
- $gtype?: GType<T>;
6329
- }
6330
-
6331
- /**
6332
- * Use this to signify a function that must be overridden in an
6333
- * implementation of the interface.
6334
- */
6335
- export class NotImplementedError extends Error {
6336
- get name(): 'NotImplementedError';
6337
- }
6338
-
6339
- export const __gtkCssName__: unique symbol;
6340
- export const __gtkTemplate__: unique symbol;
6341
- export const __gtkChildren__: unique symbol;
6342
- export const __gtkInternalChildren__: unique symbol;
6343
-
6344
- // Expose GObject static properties for ES6 classes
6345
-
6346
- export const GTypeName: unique symbol;
6347
- export const requires: unique symbol;
6348
- export const interfaces: unique symbol;
6349
- export const properties: unique symbol;
6350
- export const signals: unique symbol;
6351
-
6352
- export let gtypeNameBasedOnJSPath: boolean;
6353
-
6354
- export let TYPE_BOOLEAN: GType<boolean>;
6355
- export let Boolean: BooleanConstructor;
6356
-
6357
- export let TYPE_ENUM: GType<number>;
6358
- export let TYPE_FLAGS: GType<number>;
6359
-
6360
- export let TYPE_DOUBLE: GType<number>;
6361
- export let Double: NumberConstructor;
6362
-
6363
- export let TYPE_STRING: GType<string>;
6364
- export let String: StringConstructor;
6365
-
6366
- export let TYPE_NONE: GType<undefined>;
6367
- export let TYPE_POINTER: GType<undefined>;
6368
- export let TYPE_BOXED: GType<unknown>;
6369
- export let TYPE_PARAM: GType<unknown>;
6370
- export let TYPE_INTERFACE: GType<unknown>;
6371
- export let TYPE_OBJECT: GType<object>;
6372
- export let TYPE_VARIANT: GType<GLib.Variant>;
6373
- export let TYPE_INT: GType<number>;
6374
- export let TYPE_UINT: GType<number>;
6375
- export let TYPE_INT64: GType<number>;
6376
- export let TYPE_UINT64: GType<number>;
6377
-
6378
- // fake enum for signal accumulators, keep in sync with gi/object.c
6379
- export enum AccumulatorType {
6380
- NONE = 0,
6381
- FIRST_WINS = 1,
6382
- TRUE_HANDLED = 2,
6383
- }
6384
-
6385
- // A simple workaround if you have a class with .connect, .disconnect or .emit
6386
- // methods (such as Gio.Socket.connect or NMClient.Device.disconnect)
6387
- // The original g_signal_* functions are not introspectable anyway, because
6388
- // we need our own handling of signal argument marshalling
6389
- export function signal_connect(object: Object, name: string, handler: (...args: any[]) => any): number;
6390
- export function signal_connect_after(object: Object, name: string, handler: (...args: any[]) => any): number;
6391
- export function signal_emit_by_name(object: Object, name: string, ...args: any[]): void;
6392
-
6393
- /**
6394
- * Finds the first signal handler that matches certain selection criteria.
6395
- * The criteria are passed as properties of a match object.
6396
- * The match object has to be non-empty for successful matches.
6397
- * If no handler was found, a falsy value is returned.
6398
- *
6399
- * @param instance the instance owning the signal handler to be found.
6400
- * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
6401
- * @param match.signalId signal the handler has to be connected to.
6402
- * @param match.detail signal detail the handler has to be connected to.
6403
- * @param match.func the callback function the handler will invoke.
6404
- * @returns A valid non-0 signal handler ID for a successful match.
6405
- */
6406
- export function signal_handler_find(
6407
- instance: Object,
6408
- match: { signalId: string; detail: string; func: (...args: any[]) => any },
6409
- ): number | bigint | object | null;
6410
-
6411
- /**
6412
- * Blocks all handlers on an instance that match certain selection criteria.
6413
- * The criteria are passed as properties of a match object.
6414
- * The match object has to have at least `func` for successful matches.
6415
- * If no handlers were found, 0 is returned, the number of blocked handlers
6416
- * otherwise.
6417
- *
6418
- * @param instance the instance owning the signal handler to be found.
6419
- * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
6420
- * @param match.signalId signal the handler has to be connected to.
6421
- * @param match.detail signal detail the handler has to be connected to.
6422
- * @param match.func the callback function the handler will invoke.
6423
- * @returns The number of handlers that matched.
6424
- */
6425
- export function signal_handlers_block_matched(
6426
- instance: Object,
6427
- match: { signalId: string; detail: string; func: (...args: any[]) => any },
6428
- ): number;
6429
-
6430
- /**
6431
- * Disconnects all handlers on an instance that match certain selection
6432
- * criteria.
6433
- * The criteria are passed as properties of a match object.
6434
- * The match object has to have at least `func` for successful matches.
6435
- * If no handlers were found, 0 is returned, the number of disconnected
6436
- * handlers otherwise.
6437
- *
6438
- * @param instance the instance owning the signal handler
6439
- * to be found.
6440
- * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
6441
- * @param match.signalId signal the handler has to be connected to.
6442
- * @param match.detail signal detail the handler has to be connected to.
6443
- * @param match.func the callback function the handler will invoke.
6444
- * @returns The number of handlers that matched.
6445
- */
6446
- export function signal_handlers_unblock_matched(
6447
- instance: Object,
6448
- match: { signalId: string; detail: string; func: (...args: any[]) => any },
6449
- ): number;
6450
-
6451
- /**
6452
- * Disconnects all handlers on an instance that match certain selection
6453
- * criteria.
6454
- * The criteria are passed as properties of a match object.
6455
- * The match object has to have at least `func` for successful matches.
6456
- * If no handlers were found, 0 is returned, the number of disconnected
6457
- * handlers otherwise.
6458
- *
6459
- * @param instance the instance owning the signal handler
6460
- * to be found.
6461
- * @param match a properties object indicating whether to match by signal ID, detail, or callback function.
6462
- * @param match.signalId signal the handler has to be connected to.
6463
- * @param match.detail signal detail the handler has to be connected to.
6464
- * @param match.func the callback function the handler will invoke.
6465
- * @returns The number of handlers that matched.
6466
- */
6467
- export function signal_handlers_disconnect_matched(
6468
- instance: Object,
6469
- match: { signalId: string; detail: string; func: (...args: any[]) => any },
6470
- ): number;
6471
-
6472
- // Also match the macros used in C APIs, even though they're not introspected
6473
-
6474
- /**
6475
- * Blocks all handlers on an instance that match `func`.
6476
- *
6477
- * @param instance the instance to block handlers from.
6478
- * @param func the callback function the handler will invoke.
6479
- * @returns The number of handlers that matched.
6480
- */
6481
- export function signal_handlers_block_by_func(instance: Object, func: (...args: any[]) => any): number;
6482
-
6483
- /**
6484
- * Unblocks all handlers on an instance that match `func`.
6485
- *
6486
- * @function
6487
- * @param instance the instance to unblock handlers from.
6488
- * @param func the callback function the handler will invoke.
6489
- * @returns The number of handlers that matched.
6490
- */
6491
- export function signal_handlers_unblock_by_func(instance: Object, func: (...args: any[]) => any): number;
6492
-
6493
- /**
6494
- * Disconnects all handlers on an instance that match `func`.
6495
- *
6496
- * @param instance the instance to remove handlers from.
6497
- * @param func the callback function the handler will invoke.
6498
- * @returns The number of handlers that matched.
6499
- */
6500
- export function signal_handlers_disconnect_by_func(instance: Object, func: (...args: any[]) => any): number;
6501
- export function signal_handlers_disconnect_by_data(): void;
6502
-
6503
- export type Property<K extends ParamSpec> = K extends ParamSpec<infer T> ? T : any;
6504
-
6505
- // TODO: What about the generated class Closure
6506
- export type TClosure<R = any, P = any> = (...args: P[]) => R;
6507
-
6508
- type ObjectConstructor = { new (...args: any[]): Object };
6509
-
6510
- export function registerClass<
6511
- T extends ObjectConstructor,
6512
- Props extends { [key: string]: ParamSpec },
6513
- Interfaces extends { $gtype: GType }[],
6514
- Sigs extends {
6515
- [key: string]: {
6516
- param_types?: readonly GType[];
6517
- [key: string]: any;
6518
- };
6519
- },
6520
- >(options: MetaInfo<Props, Interfaces, Sigs>, cls: T): T;
6521
-
6522
- export function registerClass<T extends ObjectConstructor>(cls: T): T;
6523
-
6524
6608
  /**
6525
6609
  * Name of the imported GIR library
6526
6610
  * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
@@ -6534,4 +6618,5 @@ export namespace GObject {
6534
6618
  }
6535
6619
 
6536
6620
  export default GObject;
6621
+
6537
6622
  // END
package/gobject-2.0.js CHANGED
@@ -1,6 +1,5 @@
1
1
 
2
- // @ts-expect-error
3
- import GObject from 'gi://GObject?version=2.0';
4
- export { GObject };
5
- export default GObject;
2
+ // @ts-expect-error
3
+ import GObject from 'gi://GObject?version=2.0';
4
+ export default GObject;
6
5
 
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import './gobject-2.0-ambient.d.ts';
11
+
12
+ import './gobject-2.0-import.d.ts';
13
+
14
+ import GObject from './gobject-2.0.js';
15
+ export default GObject;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GObject from './gobject-2.0.js';
4
+ export default GObject;
5
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gobject-2.0",
3
- "version": "2.80.3-4.0.0-beta.6",
3
+ "version": "2.80.3-4.0.0-beta.11",
4
4
  "description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.80.3",
5
5
  "type": "module",
6
6
  "module": "gobject-2.0.js",
@@ -16,18 +16,23 @@
16
16
  "import": "./gobject-2.0-import.js",
17
17
  "default": "./gobject-2.0-import.js"
18
18
  },
19
- ".": {
19
+ "./gobject-2.0": {
20
20
  "types": "./gobject-2.0.d.ts",
21
21
  "import": "./gobject-2.0.js",
22
22
  "default": "./gobject-2.0.js"
23
+ },
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js",
27
+ "default": "./index.js"
23
28
  }
24
29
  },
25
30
  "scripts": {
26
31
  "test": "tsc --project tsconfig.json"
27
32
  },
28
33
  "dependencies": {
29
- "@girs/gjs": "^4.0.0-beta.6",
30
- "@girs/glib-2.0": "^2.80.3-4.0.0-beta.6"
34
+ "@girs/gjs": "^4.0.0-beta.11",
35
+ "@girs/glib-2.0": "^2.80.3-4.0.0-beta.11"
31
36
  },
32
37
  "devDependencies": {
33
38
  "typescript": "*"
package/tsconfig.json CHANGED
@@ -2,11 +2,11 @@
2
2
  "compilerOptions": {
3
3
  // General settings for code interpretation
4
4
  "target": "ESNext",
5
- "module": "ESNext",
5
+ "module": "NodeNext",
6
6
  "lib": ["ESNext"],
7
7
  "types": [],
8
8
  "experimentalDecorators": true,
9
- "moduleResolution": "node",
9
+ "moduleResolution": "NodeNext",
10
10
  "noEmit": true,
11
11
  "noEmitOnError": false,
12
12
  "baseUrl": "./",