Repository navigation
Conversation
|
Thanks @icopp. I'm completely unfamiliar with Typescript or what these declare statements mean. Is there any way to do all this dynamically (for example a npm build script), so that I won't have to maintain the file by hand? Given my lack of experience with this, I don't want to try this and mess it up. Also, is there anything here that needs tests? |
The short version is that the
There are scripts that will generate Typescript definitions out of JSDoc annotations, but I'm not sure how reliable they'd be in this case, given the quirks of Typescript definitions I had to work around to make this particular case work (like defining
It might be useful to add something that runs it through tslint to verify the syntax, but other than literally the only point of it is to restate the public members of the module but with those type annotations added, so IMO it'd be hard to come up tests that would actually be useful. |
|
I've been struggling with how to resolve this PR since I know you put a lot of time into this feature, and I don't want to offend you or your efforts. I don't work with TypeScript, which means it would be a bit extra burden for me to maintain this. I also don't believe TypeScript is entirely that popular, so it would affect a minority of coders. If you would like to maintain a fork, that would be OK with me. I used http://www.jeffgeerling.com/blog/2016/why-i-close-prs-oss-project-maintainer-notes as a guide to make this decision. Thanks again for your efforts. |
|
@icopp Any chance you could add this to https://github.com/DefinitelyTyped/DefinitelyTyped? |
|
@jgornick It's on the to-do list, just have to find a good time for it. |
This adds a Typescript definition file for the classes and functions in the module (based off the documentation and by me double-checking against the source), and a
typingsentry inpackage.jsonfor it.This allows anyone using Typescript who installs the module to automatically benefit from these type definitions. It has no effect (negative or positive) on anyone using it with JS.