How do you handle `connectObject` with the typescript types?

I’m trying to use the typescript types definitions from the @girs repositories together with some jsdoc.
Most of it seems good, except for the signal functions connectObject and disconnectObject.
Leading to a lot of complaints from tsserver.

I presume these methods are attached at runtime – somewhere.

Anyone have some insight on dealing with this?

Since GNOME Shell 42, connectObject and disconnectObject are getting added in ui/environment.js and you can find the implementation in misc/signalTracker.js.

We will probably have those functions in gjs in the near future but until then, GNOME Shell adding them in environment.js.

Ah, Thanks!

As far as I understand – there is no nice way of augmenting GObject.Object if I want to include these definitions.
And I would need to edit the type definition file directly.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.