JezerM / nody-greeter

LightDM greeter that allows to create wonderful themes with web technologies. Made in Node.js
https://web-greeter-page.vercel.app
GNU General Public License v3.0
125 stars 8 forks source link

Introduce type-definitions for `node-gtk` #18

Closed s0 closed 2 years ago

s0 commented 2 years ago

This PR introduces some d.ts modules for type definitions of node-gtk, and removes the related @ts-ignore

Given the nature of node-gtk, I am doubtful that any type-definitions for @types/node-gtk will include the type definitions for the LightDM library itself, but DefinitelyTyped allows the submission of type packages that aren't explicitly in NPM. So i could imagine that we could start seeing individual @types/node-gtk-X packages for each of the gobject libraries that are commonly available (perhaps we could even start this ourselves, I would be happy to).

Beyond this, I can't see there being many projects that actually want to use the type definitions for LightDM, other than perhaps the only NodeJS based lightdm greeter (i.e. this one), so there may not be that much community benefit in submitting these types to DefinitelyTyped, but yeah like I said I'm happy to start this. Given though that the DefinitelyTyped project can move very slowly, it's probably a good idea to include these changes in this repo to begin with, as a proof-of-concept that the types are correct, and to give us the extra type-safety.

Beyond this, a few improvements were made, including:

I haven't been able to thoroughly test the non-type changes I've made, and will be unable to for a few weeks, so I think it would be good for you to test that everything still works before merging this! :)

JezerM commented 2 years ago

Sorry for the late response, I'm busy these days... I made some changes and improvements to cover more of the LightDM API. However, though some methods/properties are available they do not work as expected, such as connectToDaemon and connectToDaemonFinish functions. Synchronous functions are yet recommended.

Also, yeah, I would be happy to start with node-gtk types~