@girs/gobject-2.0 2.83.3-4.0.0-beta.21 → 2.84.2-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 +1 -1
- package/gobject-2.0.d.ts +354 -50
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for GObject-2.0, generated from library version 2.
|
|
8
|
+
GJS TypeScript type definitions for GObject-2.0, generated from library version 2.84.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.24.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
package/gobject-2.0.d.ts
CHANGED
|
@@ -7,13 +7,17 @@
|
|
|
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 GLib from '@girs/glib-2.0';
|
|
12
14
|
|
|
13
15
|
export namespace GObject {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Obtain the parameters of a function type in a tuple.
|
|
18
|
+
* Note: This is a copy of the Parameters type from the TypeScript standard library to avoid name conflicts, as some GIR types define `Parameters` as a namespace.
|
|
19
|
+
*/
|
|
20
|
+
export type GjsParameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
|
|
17
21
|
|
|
18
22
|
// __type__ forces all GTypes to not match structurally.
|
|
19
23
|
export type GType<T = unknown> = {
|
|
@@ -229,6 +233,19 @@ export namespace GObject {
|
|
|
229
233
|
|
|
230
234
|
export type Property<K extends ParamSpec> = K extends ParamSpec<infer T> ? T : any;
|
|
231
235
|
|
|
236
|
+
// Helper types for type-safe signal handling
|
|
237
|
+
export interface SignalSignatures {
|
|
238
|
+
/** Fallback for dynamic signals and type compatibility */
|
|
239
|
+
[signal: string]: (...args: any[]) => any;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Helper to prepend the emitter (`source`) to an existing callback type.
|
|
244
|
+
*/
|
|
245
|
+
export type SignalCallback<Emitter, Fn> = Fn extends (...args: infer P) => infer R
|
|
246
|
+
? (source: Emitter, ...args: P) => R
|
|
247
|
+
: never;
|
|
248
|
+
|
|
232
249
|
// TODO: What about the generated class Closure
|
|
233
250
|
export type TClosure<R = any, P = any> = (...args: P[]) => R;
|
|
234
251
|
|
|
@@ -2750,20 +2767,23 @@ export namespace GObject {
|
|
|
2750
2767
|
*/
|
|
2751
2768
|
NO_HOOKS,
|
|
2752
2769
|
/**
|
|
2753
|
-
* Varargs signal emission will always collect the
|
|
2754
|
-
*
|
|
2770
|
+
* Varargs signal emission will always collect the arguments, even if there
|
|
2771
|
+
* are no signal handlers connected.
|
|
2755
2772
|
*/
|
|
2756
2773
|
MUST_COLLECT,
|
|
2757
2774
|
/**
|
|
2758
|
-
* The signal is deprecated and will be removed
|
|
2759
|
-
*
|
|
2760
|
-
*
|
|
2775
|
+
* The signal is deprecated and will be removed in a future version.
|
|
2776
|
+
*
|
|
2777
|
+
* A warning will be generated if it is connected while running with
|
|
2778
|
+
* `G_ENABLE_DIAGNOSTIC=1`.
|
|
2761
2779
|
*/
|
|
2762
2780
|
DEPRECATED,
|
|
2763
2781
|
/**
|
|
2764
|
-
*
|
|
2765
|
-
*
|
|
2766
|
-
*
|
|
2782
|
+
* The signal accumulator was invoked for the first time.
|
|
2783
|
+
*
|
|
2784
|
+
* This flag is only used in [callback`GObject`.SignalAccumulator][accumulator functions]
|
|
2785
|
+
* for the `run_type` field of the [struct`GObject`.SignalInvocationHint], to
|
|
2786
|
+
* mark the first call to the accumulator function for a signal emission.
|
|
2767
2787
|
*/
|
|
2768
2788
|
ACCUMULATOR_FIRST_RUN,
|
|
2769
2789
|
}
|
|
@@ -2920,6 +2940,15 @@ export namespace GObject {
|
|
|
2920
2940
|
DEEP_DERIVABLE,
|
|
2921
2941
|
}
|
|
2922
2942
|
namespace Binding {
|
|
2943
|
+
// Signal signatures
|
|
2944
|
+
interface SignalSignatures extends Object.SignalSignatures {
|
|
2945
|
+
'notify::flags': (pspec: ParamSpec) => void;
|
|
2946
|
+
'notify::source': (pspec: ParamSpec) => void;
|
|
2947
|
+
'notify::source-property': (pspec: ParamSpec) => void;
|
|
2948
|
+
'notify::target': (pspec: ParamSpec) => void;
|
|
2949
|
+
'notify::target-property': (pspec: ParamSpec) => void;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2923
2952
|
// Constructor properties interface
|
|
2924
2953
|
|
|
2925
2954
|
interface ConstructorProps extends Object.ConstructorProps {
|
|
@@ -3060,12 +3089,39 @@ export namespace GObject {
|
|
|
3060
3089
|
*/
|
|
3061
3090
|
get targetProperty(): string;
|
|
3062
3091
|
|
|
3092
|
+
/**
|
|
3093
|
+
* Compile-time signal type information.
|
|
3094
|
+
*
|
|
3095
|
+
* This instance property is generated only for TypeScript type checking.
|
|
3096
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
3097
|
+
* @internal
|
|
3098
|
+
*/
|
|
3099
|
+
$signals: Binding.SignalSignatures;
|
|
3100
|
+
|
|
3063
3101
|
// Constructors
|
|
3064
3102
|
|
|
3065
3103
|
constructor(properties?: Partial<Binding.ConstructorProps>, ...args: any[]);
|
|
3066
3104
|
|
|
3067
3105
|
_init(...args: any[]): void;
|
|
3068
3106
|
|
|
3107
|
+
// Signals
|
|
3108
|
+
|
|
3109
|
+
connect<K extends keyof Binding.SignalSignatures>(
|
|
3110
|
+
signal: K,
|
|
3111
|
+
callback: SignalCallback<this, Binding.SignalSignatures[K]>,
|
|
3112
|
+
): number;
|
|
3113
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
3114
|
+
connect_after<K extends keyof Binding.SignalSignatures>(
|
|
3115
|
+
signal: K,
|
|
3116
|
+
callback: SignalCallback<this, Binding.SignalSignatures[K]>,
|
|
3117
|
+
): number;
|
|
3118
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
3119
|
+
emit<K extends keyof Binding.SignalSignatures>(
|
|
3120
|
+
signal: K,
|
|
3121
|
+
...args: GjsParameters<Binding.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
3122
|
+
): void;
|
|
3123
|
+
emit(signal: string, ...args: any[]): void;
|
|
3124
|
+
|
|
3069
3125
|
// Methods
|
|
3070
3126
|
|
|
3071
3127
|
/**
|
|
@@ -3146,6 +3202,11 @@ export namespace GObject {
|
|
|
3146
3202
|
}
|
|
3147
3203
|
|
|
3148
3204
|
namespace BindingGroup {
|
|
3205
|
+
// Signal signatures
|
|
3206
|
+
interface SignalSignatures extends Object.SignalSignatures {
|
|
3207
|
+
'notify::source': (pspec: ParamSpec) => void;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3149
3210
|
// Constructor properties interface
|
|
3150
3211
|
|
|
3151
3212
|
interface ConstructorProps extends Object.ConstructorProps {
|
|
@@ -3173,6 +3234,15 @@ export namespace GObject {
|
|
|
3173
3234
|
get source(): Object;
|
|
3174
3235
|
set source(val: Object);
|
|
3175
3236
|
|
|
3237
|
+
/**
|
|
3238
|
+
* Compile-time signal type information.
|
|
3239
|
+
*
|
|
3240
|
+
* This instance property is generated only for TypeScript type checking.
|
|
3241
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
3242
|
+
* @internal
|
|
3243
|
+
*/
|
|
3244
|
+
$signals: BindingGroup.SignalSignatures;
|
|
3245
|
+
|
|
3176
3246
|
// Constructors
|
|
3177
3247
|
|
|
3178
3248
|
constructor(properties?: Partial<BindingGroup.ConstructorProps>, ...args: any[]);
|
|
@@ -3181,6 +3251,24 @@ export namespace GObject {
|
|
|
3181
3251
|
|
|
3182
3252
|
static ['new'](): BindingGroup;
|
|
3183
3253
|
|
|
3254
|
+
// Signals
|
|
3255
|
+
|
|
3256
|
+
connect<K extends keyof BindingGroup.SignalSignatures>(
|
|
3257
|
+
signal: K,
|
|
3258
|
+
callback: SignalCallback<this, BindingGroup.SignalSignatures[K]>,
|
|
3259
|
+
): number;
|
|
3260
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
3261
|
+
connect_after<K extends keyof BindingGroup.SignalSignatures>(
|
|
3262
|
+
signal: K,
|
|
3263
|
+
callback: SignalCallback<this, BindingGroup.SignalSignatures[K]>,
|
|
3264
|
+
): number;
|
|
3265
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
3266
|
+
emit<K extends keyof BindingGroup.SignalSignatures>(
|
|
3267
|
+
signal: K,
|
|
3268
|
+
...args: GjsParameters<BindingGroup.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
3269
|
+
): void;
|
|
3270
|
+
emit(signal: string, ...args: any[]): void;
|
|
3271
|
+
|
|
3184
3272
|
// Methods
|
|
3185
3273
|
|
|
3186
3274
|
/**
|
|
@@ -3261,6 +3349,9 @@ export namespace GObject {
|
|
|
3261
3349
|
}
|
|
3262
3350
|
|
|
3263
3351
|
namespace InitiallyUnowned {
|
|
3352
|
+
// Signal signatures
|
|
3353
|
+
interface SignalSignatures extends Object.SignalSignatures {}
|
|
3354
|
+
|
|
3264
3355
|
// Constructor properties interface
|
|
3265
3356
|
|
|
3266
3357
|
interface ConstructorProps extends Object.ConstructorProps {}
|
|
@@ -3275,18 +3366,44 @@ export namespace GObject {
|
|
|
3275
3366
|
class InitiallyUnowned extends Object {
|
|
3276
3367
|
static $gtype: GType<InitiallyUnowned>;
|
|
3277
3368
|
|
|
3369
|
+
/**
|
|
3370
|
+
* Compile-time signal type information.
|
|
3371
|
+
*
|
|
3372
|
+
* This instance property is generated only for TypeScript type checking.
|
|
3373
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
3374
|
+
* @internal
|
|
3375
|
+
*/
|
|
3376
|
+
$signals: InitiallyUnowned.SignalSignatures;
|
|
3377
|
+
|
|
3278
3378
|
// Constructors
|
|
3279
3379
|
|
|
3280
3380
|
constructor(properties?: Partial<InitiallyUnowned.ConstructorProps>, ...args: any[]);
|
|
3281
3381
|
|
|
3282
3382
|
_init(...args: any[]): void;
|
|
3383
|
+
|
|
3384
|
+
// Signals
|
|
3385
|
+
|
|
3386
|
+
connect<K extends keyof InitiallyUnowned.SignalSignatures>(
|
|
3387
|
+
signal: K,
|
|
3388
|
+
callback: SignalCallback<this, InitiallyUnowned.SignalSignatures[K]>,
|
|
3389
|
+
): number;
|
|
3390
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
3391
|
+
connect_after<K extends keyof InitiallyUnowned.SignalSignatures>(
|
|
3392
|
+
signal: K,
|
|
3393
|
+
callback: SignalCallback<this, InitiallyUnowned.SignalSignatures[K]>,
|
|
3394
|
+
): number;
|
|
3395
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
3396
|
+
emit<K extends keyof InitiallyUnowned.SignalSignatures>(
|
|
3397
|
+
signal: K,
|
|
3398
|
+
...args: GjsParameters<InitiallyUnowned.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
3399
|
+
): void;
|
|
3400
|
+
emit(signal: string, ...args: any[]): void;
|
|
3283
3401
|
}
|
|
3284
3402
|
|
|
3285
3403
|
namespace Object {
|
|
3286
|
-
// Signal
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
(pspec: ParamSpec): void;
|
|
3404
|
+
// Signal signatures
|
|
3405
|
+
interface SignalSignatures {
|
|
3406
|
+
notify: (arg0: ParamSpec) => void;
|
|
3290
3407
|
}
|
|
3291
3408
|
|
|
3292
3409
|
// Constructor properties interface
|
|
@@ -3321,6 +3438,15 @@ export namespace GObject {
|
|
|
3321
3438
|
class Object {
|
|
3322
3439
|
static $gtype: GType<Object>;
|
|
3323
3440
|
|
|
3441
|
+
/**
|
|
3442
|
+
* Compile-time signal type information.
|
|
3443
|
+
*
|
|
3444
|
+
* This instance property is generated only for TypeScript type checking.
|
|
3445
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
3446
|
+
* @internal
|
|
3447
|
+
*/
|
|
3448
|
+
$signals: Object.SignalSignatures;
|
|
3449
|
+
|
|
3324
3450
|
// Constructors
|
|
3325
3451
|
|
|
3326
3452
|
_init(...args: any[]): void;
|
|
@@ -3329,12 +3455,21 @@ export namespace GObject {
|
|
|
3329
3455
|
|
|
3330
3456
|
// Signals
|
|
3331
3457
|
|
|
3332
|
-
connect
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3458
|
+
connect<K extends keyof Object.SignalSignatures>(
|
|
3459
|
+
signal: K,
|
|
3460
|
+
callback: SignalCallback<this, Object.SignalSignatures[K]>,
|
|
3461
|
+
): number;
|
|
3462
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
3463
|
+
connect_after<K extends keyof Object.SignalSignatures>(
|
|
3464
|
+
signal: K,
|
|
3465
|
+
callback: SignalCallback<this, Object.SignalSignatures[K]>,
|
|
3466
|
+
): number;
|
|
3467
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
3468
|
+
emit<K extends keyof Object.SignalSignatures>(
|
|
3469
|
+
signal: K,
|
|
3470
|
+
...args: GjsParameters<Object.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
3471
|
+
): void;
|
|
3472
|
+
emit(signal: string, ...args: any[]): void;
|
|
3338
3473
|
|
|
3339
3474
|
// Static methods
|
|
3340
3475
|
|
|
@@ -3594,7 +3729,21 @@ export namespace GObject {
|
|
|
3594
3729
|
* @returns the data if found, or %NULL if no such data exists.
|
|
3595
3730
|
*/
|
|
3596
3731
|
get_data(key: string): any | null;
|
|
3597
|
-
|
|
3732
|
+
/**
|
|
3733
|
+
* Gets a property of an object.
|
|
3734
|
+
*
|
|
3735
|
+
* The value can be:
|
|
3736
|
+
* - 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)
|
|
3737
|
+
* - a GObject.Value initialized with the expected type of the property
|
|
3738
|
+
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
|
|
3739
|
+
*
|
|
3740
|
+
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
|
|
3741
|
+
*
|
|
3742
|
+
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
|
|
3743
|
+
* @param property_name The name of the property to get
|
|
3744
|
+
* @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
|
|
3745
|
+
*/
|
|
3746
|
+
get_property(property_name: string, value: Value | any): any;
|
|
3598
3747
|
/**
|
|
3599
3748
|
* This function gets back user data pointers stored via
|
|
3600
3749
|
* g_object_set_qdata().
|
|
@@ -3722,7 +3871,12 @@ export namespace GObject {
|
|
|
3722
3871
|
* @param data data to associate with that key
|
|
3723
3872
|
*/
|
|
3724
3873
|
set_data(key: string, data?: any | null): void;
|
|
3725
|
-
|
|
3874
|
+
/**
|
|
3875
|
+
* Sets a property on an object.
|
|
3876
|
+
* @param property_name The name of the property to set
|
|
3877
|
+
* @param value The value to set the property to
|
|
3878
|
+
*/
|
|
3879
|
+
set_property(property_name: string, value: Value | any): void;
|
|
3726
3880
|
/**
|
|
3727
3881
|
* Remove a specified datum from the object's data associations,
|
|
3728
3882
|
* without invoking the association's destroy handler.
|
|
@@ -3807,11 +3961,36 @@ export namespace GObject {
|
|
|
3807
3961
|
* @param closure #GClosure to watch
|
|
3808
3962
|
*/
|
|
3809
3963
|
watch_closure(closure: Closure): void;
|
|
3964
|
+
/**
|
|
3965
|
+
* 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.
|
|
3966
|
+
* @param id Handler ID of the handler to be disconnected
|
|
3967
|
+
*/
|
|
3810
3968
|
disconnect(id: number): void;
|
|
3969
|
+
/**
|
|
3970
|
+
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
|
|
3971
|
+
* @param properties Object containing the properties to set
|
|
3972
|
+
*/
|
|
3811
3973
|
set(properties: { [key: string]: any }): void;
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3974
|
+
/**
|
|
3975
|
+
* Blocks a handler of an instance so it will not be called during any signal emissions
|
|
3976
|
+
* @param id Handler ID of the handler to be blocked
|
|
3977
|
+
*/
|
|
3978
|
+
block_signal_handler(id: number): void;
|
|
3979
|
+
/**
|
|
3980
|
+
* Unblocks a handler so it will be called again during any signal emissions
|
|
3981
|
+
* @param id Handler ID of the handler to be unblocked
|
|
3982
|
+
*/
|
|
3983
|
+
unblock_signal_handler(id: number): void;
|
|
3984
|
+
/**
|
|
3985
|
+
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
|
|
3986
|
+
* @param detailedName Name of the signal to stop emission of
|
|
3987
|
+
*/
|
|
3988
|
+
stop_emission_by_name(detailedName: string): void;
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
namespace ParamSpec {
|
|
3992
|
+
// Signal signatures
|
|
3993
|
+
interface SignalSignatures extends Object.SignalSignatures {}
|
|
3815
3994
|
}
|
|
3816
3995
|
|
|
3817
3996
|
/**
|
|
@@ -3832,6 +4011,24 @@ export namespace GObject {
|
|
|
3832
4011
|
|
|
3833
4012
|
_init(...args: any[]): void;
|
|
3834
4013
|
|
|
4014
|
+
// Signals
|
|
4015
|
+
|
|
4016
|
+
connect<K extends keyof ParamSpec.SignalSignatures>(
|
|
4017
|
+
signal: K,
|
|
4018
|
+
callback: SignalCallback<this, ParamSpec.SignalSignatures[K]>,
|
|
4019
|
+
): number;
|
|
4020
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
4021
|
+
connect_after<K extends keyof ParamSpec.SignalSignatures>(
|
|
4022
|
+
signal: K,
|
|
4023
|
+
callback: SignalCallback<this, ParamSpec.SignalSignatures[K]>,
|
|
4024
|
+
): number;
|
|
4025
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
4026
|
+
emit<K extends keyof ParamSpec.SignalSignatures>(
|
|
4027
|
+
signal: K,
|
|
4028
|
+
...args: GjsParameters<ParamSpec.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
4029
|
+
): void;
|
|
4030
|
+
emit(signal: string, ...args: any[]): void;
|
|
4031
|
+
|
|
3835
4032
|
// Static methods
|
|
3836
4033
|
|
|
3837
4034
|
/**
|
|
@@ -4096,11 +4293,19 @@ export namespace GObject {
|
|
|
4096
4293
|
flags: ParamFlags | number,
|
|
4097
4294
|
boxedType: GType<T> | { $gtype: GType<T> },
|
|
4098
4295
|
): ParamSpec<T>;
|
|
4296
|
+
/**
|
|
4297
|
+
* Creates a new GParamSpecObject instance specifying a property holding object references.
|
|
4298
|
+
* @param name The name of the property
|
|
4299
|
+
* @param nick A human readable name for the property (can be null)
|
|
4300
|
+
* @param blurb A longer description of the property (can be null)
|
|
4301
|
+
* @param flags The flags for this property (e.g. READABLE, WRITABLE)
|
|
4302
|
+
* @param objectType The GType of the object
|
|
4303
|
+
*/
|
|
4099
4304
|
static object<T>(
|
|
4100
4305
|
name: string,
|
|
4101
4306
|
nick: string | null,
|
|
4102
4307
|
blurb: string | null,
|
|
4103
|
-
flags:
|
|
4308
|
+
flags: ParamFlags | number,
|
|
4104
4309
|
objectType: GType<T> | { $gtype: GType<T> },
|
|
4105
4310
|
): ParamSpec<T>;
|
|
4106
4311
|
/**
|
|
@@ -4118,7 +4323,19 @@ export namespace GObject {
|
|
|
4118
4323
|
flags: ParamFlags | number,
|
|
4119
4324
|
paramType: any,
|
|
4120
4325
|
): ParamSpec;
|
|
4121
|
-
|
|
4326
|
+
/**
|
|
4327
|
+
* Creates a new ParamSpec instance for JavaScript object properties.
|
|
4328
|
+
* @param name The name of the property
|
|
4329
|
+
* @param nick A human readable name for the property (can be null)
|
|
4330
|
+
* @param blurb A longer description of the property (can be null)
|
|
4331
|
+
* @param flags The flags for this property (e.g. READABLE, WRITABLE)
|
|
4332
|
+
*/
|
|
4333
|
+
static jsobject<T>(
|
|
4334
|
+
name: string,
|
|
4335
|
+
nick: string | null,
|
|
4336
|
+
blurb: string | null,
|
|
4337
|
+
flags: ParamFlags | number,
|
|
4338
|
+
): ParamSpec<T>;
|
|
4122
4339
|
|
|
4123
4340
|
// Virtual methods
|
|
4124
4341
|
|
|
@@ -4235,18 +4452,21 @@ export namespace GObject {
|
|
|
4235
4452
|
* @returns the user data pointer set, or %NULL
|
|
4236
4453
|
*/
|
|
4237
4454
|
steal_qdata(quark: GLib.Quark): any | null;
|
|
4455
|
+
/**
|
|
4456
|
+
* Registers a property override for a property introduced in a parent class or inherited interface.
|
|
4457
|
+
* @param name The name of the property to override
|
|
4458
|
+
* @param oclass The object class or type that contains the property to override
|
|
4459
|
+
*/
|
|
4238
4460
|
override(name: string, oclass: Object | Function | GType): void;
|
|
4239
4461
|
}
|
|
4240
4462
|
|
|
4241
4463
|
namespace SignalGroup {
|
|
4242
|
-
// Signal
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
interface Unbind {
|
|
4249
|
-
(): void;
|
|
4464
|
+
// Signal signatures
|
|
4465
|
+
interface SignalSignatures extends Object.SignalSignatures {
|
|
4466
|
+
bind: (arg0: Object) => void;
|
|
4467
|
+
unbind: () => void;
|
|
4468
|
+
'notify::target': (pspec: ParamSpec) => void;
|
|
4469
|
+
'notify::target-type': (pspec: ParamSpec) => void;
|
|
4250
4470
|
}
|
|
4251
4471
|
|
|
4252
4472
|
// Constructor properties interface
|
|
@@ -4298,6 +4518,15 @@ export namespace GObject {
|
|
|
4298
4518
|
*/
|
|
4299
4519
|
get targetType(): GType;
|
|
4300
4520
|
|
|
4521
|
+
/**
|
|
4522
|
+
* Compile-time signal type information.
|
|
4523
|
+
*
|
|
4524
|
+
* This instance property is generated only for TypeScript type checking.
|
|
4525
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
4526
|
+
* @internal
|
|
4527
|
+
*/
|
|
4528
|
+
$signals: SignalGroup.SignalSignatures;
|
|
4529
|
+
|
|
4301
4530
|
// Constructors
|
|
4302
4531
|
|
|
4303
4532
|
constructor(properties?: Partial<SignalGroup.ConstructorProps>, ...args: any[]);
|
|
@@ -4308,15 +4537,21 @@ export namespace GObject {
|
|
|
4308
4537
|
|
|
4309
4538
|
// Signals
|
|
4310
4539
|
|
|
4311
|
-
connect
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4540
|
+
connect<K extends keyof SignalGroup.SignalSignatures>(
|
|
4541
|
+
signal: K,
|
|
4542
|
+
callback: SignalCallback<this, SignalGroup.SignalSignatures[K]>,
|
|
4543
|
+
): number;
|
|
4544
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
4545
|
+
connect_after<K extends keyof SignalGroup.SignalSignatures>(
|
|
4546
|
+
signal: K,
|
|
4547
|
+
callback: SignalCallback<this, SignalGroup.SignalSignatures[K]>,
|
|
4548
|
+
): number;
|
|
4549
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
4550
|
+
emit<K extends keyof SignalGroup.SignalSignatures>(
|
|
4551
|
+
signal: K,
|
|
4552
|
+
...args: GjsParameters<SignalGroup.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
4553
|
+
): void;
|
|
4554
|
+
emit(signal: string, ...args: any[]): void;
|
|
4320
4555
|
|
|
4321
4556
|
// Methods
|
|
4322
4557
|
|
|
@@ -4390,6 +4625,9 @@ export namespace GObject {
|
|
|
4390
4625
|
}
|
|
4391
4626
|
|
|
4392
4627
|
namespace TypeModule {
|
|
4628
|
+
// Signal signatures
|
|
4629
|
+
interface SignalSignatures extends Object.SignalSignatures {}
|
|
4630
|
+
|
|
4393
4631
|
// Constructor properties interface
|
|
4394
4632
|
|
|
4395
4633
|
interface ConstructorProps extends Object.ConstructorProps, TypePlugin.ConstructorProps {}
|
|
@@ -4431,6 +4669,15 @@ export namespace GObject {
|
|
|
4431
4669
|
abstract class TypeModule extends Object implements TypePlugin {
|
|
4432
4670
|
static $gtype: GType<TypeModule>;
|
|
4433
4671
|
|
|
4672
|
+
/**
|
|
4673
|
+
* Compile-time signal type information.
|
|
4674
|
+
*
|
|
4675
|
+
* This instance property is generated only for TypeScript type checking.
|
|
4676
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
4677
|
+
* @internal
|
|
4678
|
+
*/
|
|
4679
|
+
$signals: TypeModule.SignalSignatures;
|
|
4680
|
+
|
|
4434
4681
|
// Fields
|
|
4435
4682
|
|
|
4436
4683
|
use_count: number;
|
|
@@ -4444,6 +4691,24 @@ export namespace GObject {
|
|
|
4444
4691
|
|
|
4445
4692
|
_init(...args: any[]): void;
|
|
4446
4693
|
|
|
4694
|
+
// Signals
|
|
4695
|
+
|
|
4696
|
+
connect<K extends keyof TypeModule.SignalSignatures>(
|
|
4697
|
+
signal: K,
|
|
4698
|
+
callback: SignalCallback<this, TypeModule.SignalSignatures[K]>,
|
|
4699
|
+
): number;
|
|
4700
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
4701
|
+
connect_after<K extends keyof TypeModule.SignalSignatures>(
|
|
4702
|
+
signal: K,
|
|
4703
|
+
callback: SignalCallback<this, TypeModule.SignalSignatures[K]>,
|
|
4704
|
+
): number;
|
|
4705
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
4706
|
+
emit<K extends keyof TypeModule.SignalSignatures>(
|
|
4707
|
+
signal: K,
|
|
4708
|
+
...args: GjsParameters<TypeModule.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
4709
|
+
): void;
|
|
4710
|
+
emit(signal: string, ...args: any[]): void;
|
|
4711
|
+
|
|
4447
4712
|
// Virtual methods
|
|
4448
4713
|
|
|
4449
4714
|
/**
|
|
@@ -4687,7 +4952,21 @@ export namespace GObject {
|
|
|
4687
4952
|
* @returns the data if found, or %NULL if no such data exists.
|
|
4688
4953
|
*/
|
|
4689
4954
|
get_data(key: string): any | null;
|
|
4690
|
-
|
|
4955
|
+
/**
|
|
4956
|
+
* Gets a property of an object.
|
|
4957
|
+
*
|
|
4958
|
+
* The value can be:
|
|
4959
|
+
* - 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)
|
|
4960
|
+
* - a GObject.Value initialized with the expected type of the property
|
|
4961
|
+
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
|
|
4962
|
+
*
|
|
4963
|
+
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
|
|
4964
|
+
*
|
|
4965
|
+
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
|
|
4966
|
+
* @param property_name The name of the property to get
|
|
4967
|
+
* @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
|
|
4968
|
+
*/
|
|
4969
|
+
get_property(property_name: string, value: Value | any): any;
|
|
4691
4970
|
/**
|
|
4692
4971
|
* This function gets back user data pointers stored via
|
|
4693
4972
|
* g_object_set_qdata().
|
|
@@ -4815,7 +5094,12 @@ export namespace GObject {
|
|
|
4815
5094
|
* @param data data to associate with that key
|
|
4816
5095
|
*/
|
|
4817
5096
|
set_data(key: string, data?: any | null): void;
|
|
4818
|
-
|
|
5097
|
+
/**
|
|
5098
|
+
* Sets a property on an object.
|
|
5099
|
+
* @param property_name The name of the property to set
|
|
5100
|
+
* @param value The value to set the property to
|
|
5101
|
+
*/
|
|
5102
|
+
set_property(property_name: string, value: Value | any): void;
|
|
4819
5103
|
/**
|
|
4820
5104
|
* Remove a specified datum from the object's data associations,
|
|
4821
5105
|
* without invoking the association's destroy handler.
|
|
@@ -4965,11 +5249,31 @@ export namespace GObject {
|
|
|
4965
5249
|
* @param pspec
|
|
4966
5250
|
*/
|
|
4967
5251
|
vfunc_set_property(property_id: number, value: Value | any, pspec: ParamSpec): void;
|
|
5252
|
+
/**
|
|
5253
|
+
* 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.
|
|
5254
|
+
* @param id Handler ID of the handler to be disconnected
|
|
5255
|
+
*/
|
|
4968
5256
|
disconnect(id: number): void;
|
|
5257
|
+
/**
|
|
5258
|
+
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
|
|
5259
|
+
* @param properties Object containing the properties to set
|
|
5260
|
+
*/
|
|
4969
5261
|
set(properties: { [key: string]: any }): void;
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
5262
|
+
/**
|
|
5263
|
+
* Blocks a handler of an instance so it will not be called during any signal emissions
|
|
5264
|
+
* @param id Handler ID of the handler to be blocked
|
|
5265
|
+
*/
|
|
5266
|
+
block_signal_handler(id: number): void;
|
|
5267
|
+
/**
|
|
5268
|
+
* Unblocks a handler so it will be called again during any signal emissions
|
|
5269
|
+
* @param id Handler ID of the handler to be unblocked
|
|
5270
|
+
*/
|
|
5271
|
+
unblock_signal_handler(id: number): void;
|
|
5272
|
+
/**
|
|
5273
|
+
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
|
|
5274
|
+
* @param detailedName Name of the signal to stop emission of
|
|
5275
|
+
*/
|
|
5276
|
+
stop_emission_by_name(detailedName: string): void;
|
|
4973
5277
|
}
|
|
4974
5278
|
|
|
4975
5279
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gobject-2.0",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.
|
|
3
|
+
"version": "2.84.2-4.0.0-beta.24",
|
|
4
|
+
"description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.84.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gobject-2.0.js",
|
|
7
7
|
"main": "gobject-2.0.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
35
|
-
"@girs/glib-2.0": "^2.
|
|
34
|
+
"@girs/gjs": "^4.0.0-beta.24",
|
|
35
|
+
"@girs/glib-2.0": "^2.84.2-4.0.0-beta.24"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "*"
|