Add Typescript type definitions#54
Conversation
|
Hi @TheActualWalko! Thank you so much for your contribution. |
|
@gerardobort my pleasure! Good idea re: tests to confirm the types stay in sync. I'm relatively seasoned with TS, but this is my first time submitting type annotations for an all-JS project - I'm afraid I haven't got any firsthand experience implementing such tests. After looking around, this looks like a promising option from the TS implementers: https://github.com/microsoft/dtslint. Here it is in action on the express.js type library: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express/express-tests.ts#L124 I can implement this when I have some free time. However, the ultimate way of accomplishing this would be to convert the project to TS. I would be more than happy to help if you find yourself coming to believe that it would be a worthwhile move. It would be ideal to make the switch before the project grows in size. If I may make one remark to support going TS, the work I did digging around for public type annotations did reveal a few potential bugs (mostly toJSON methods including class instances in their return values - check out my comments in the .d.ts file for more details) and going all-in on typing would almost certainly reveal more potential improvements. |
No description provided.