-
Notifications
You must be signed in to change notification settings - Fork 773
Add a TypeScript definition #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Anyone interested, I've started work at aendrew/github#typescript_def. It's completely unfinished and I'm struggling with the syntax, so any help is quite welcome. |
Apparently you can generate these via jsDoc. I'd really prefer to write these all in one place and then have tooling (Possibly this) generate any copies, so will add these to the definition for the moment and then migrate that documentation into the actual code itself sometime around 0.11.0 (I'd do so now but it'd change the shape of the code enough that it'd likely cause a large number of existent PRs to conflict). |
@Aendrew Are you still interested in this? |
@AurelioDeRosa Yep, absolutely, just a bit delayed. Probably a good thing though; ambient definitions have changed a bit since I posted this. Currently researching the best way to add a def to a lib. |
@Aendrew We're all jsdoc'd up so integrating this shouldn't be too hard if you want to. |
@Aendrew Have you made any progress on your research? |
Here's a first pass, I've merely generated the d.ts from jsDoc and haven't had time to play with the definition beyond that: https://github.com/aendrew/github/tree/d.ts The declaration itself is at: https://github.com/aendrew/github/blob/d.ts/github-api.d.ts There are a bunch of errors being thrown, given that jsDoc comments that will need to be fixed:
On a whole, though, y'all done a crazy-good job of documenting everything, am semi-surprised everything worked this well! I'll probably write a mass PR in the next few days that resolves all of the above and lets |
See above PR if you want to test the definition I've been working on. Automatic generation is about 95% of the way there; once tsd-jsdoc is fixed upstream it'll be worth adding d.ts generation as a build step. |
This will help adoption by people who use TypeScript and doesn't impact the library any other way.
I'll do this because I want it and have experience with TS.
The text was updated successfully, but these errors were encountered: