SignalMethods.connect's callback return type is incorrect
|
connect<Name extends keyof S>(sigName: Name, callback: (self: this, ...args: S[Name]) => boolean | undefined): number; |
It should probably be: boolean | void or boolean | any or even true | any (though it seems redundant to have or any as a type)
as per the documentation:
If callback returns true, emission will stop and no other handlers will be invoked.
Checked the original implementation that's in gjs, and it really only checks for true:
https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/_signals.js?ref_type=heads#L134
The thing is, this is in gjs. And seems like it is intended to be in @girs/gjs :
|
// TODO Move this SignalMethods to ts-for-gir / @girs/gjs |
But there is already a slightly different type in @girs/gjs's types:
https://github.com/gjsify/types/blob/87c06b320d4754fbffb4043d9142a089a42a62db/gjs/gjs.d.ts#L370
So.. should it be fixed in gjs and removed from here, or it cannot be fixed there? (idk how the type generation works there)
Or should it just be fixed here (for now).
SignalMethods.connect's callback return type is incorrect
gnome-shell/packages/gnome-shell/src/misc/signals.d.ts
Line 44 in 37aef38
It should probably be:
boolean | voidorboolean | anyor eventrue | any(though it seems redundant to haveor anyas a type)as per the documentation:
Checked the original implementation that's in gjs, and it really only checks for true:
https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/_signals.js?ref_type=heads#L134
The thing is, this is in gjs. And seems like it is intended to be in @girs/gjs :
gnome-shell/packages/gnome-shell/src/misc/signals.d.ts
Line 3 in 37aef38
But there is already a slightly different type in @girs/gjs's types:
https://github.com/gjsify/types/blob/87c06b320d4754fbffb4043d9142a089a42a62db/gjs/gjs.d.ts#L370
So.. should it be fixed in gjs and removed from here, or it cannot be fixed there? (idk how the type generation works there)
Or should it just be fixed here (for now).