Skip to content
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

Add typescript types #1

Closed
gbersac opened this issue Jan 27, 2018 · 10 comments
Closed

Add typescript types #1

gbersac opened this issue Jan 27, 2018 · 10 comments

Comments

@gbersac
Copy link

gbersac commented Jan 27, 2018

Hi, your package is exactly what I am looking for, but I am using typescript and there seems not to be types associated with your package. I tried npm install @types/node-graceful but there is no such package. Please you or someone else create one !

@mrbar42
Copy link
Owner

mrbar42 commented Jan 28, 2018

Thanks for opening an issue!
great idea, I'll try to find time and do that or someone might beat me to it 😄

@mrbar42
Copy link
Owner

mrbar42 commented Jan 28, 2018

@gbersac checkout version v0.2.4

@gbersac
Copy link
Author

gbersac commented Jan 28, 2018

@mrbar42 Great, that was quick ! For typescript users to know that there is types available for this package, you should release the types so that they are accessible using npm i @type/node-graceful --save-dev. That's what they'll type when they will be looking for the types of this module ^^

@mrbar42
Copy link
Owner

mrbar42 commented Jan 28, 2018 via email

@gbersac
Copy link
Author

gbersac commented Jan 29, 2018

@mrbar42 I don't really know. All I know is that, if I type npm i @type/node-graceful , it doesn't find the package. But maybe it is because you didn't published your update to npm.

@yss14
Copy link

yss14 commented Mar 7, 2018

Quote from DefinitelyTyped:

If you are the library author, or can make a pull request to the library, bundle types instead of publishing to DefinitelyTyped.

But for me the typings unfortunately don't work:

Could not find a declaration file for module 'node-graceful'. '<path>/node_modules/node-graceful/graceful.js' implicitly has an 'any' type.
  Try `npm install @types/node-graceful` if it exists or add a new declaration (.d.ts) file containing `declare module 'node-graceful';`

@mrbar42
Copy link
Owner

mrbar42 commented Mar 9, 2018

@yss14 Thanks for sharing the error, it turns out typescript expects the d.ts file to be named index.d.ts which was fixed in #2

checkout the latest version (v0.3.0) and share any further problems

@awwong1
Copy link
Contributor

awwong1 commented Mar 22, 2018

[ts] Generic type 'Promise<T>' requires 1 type argument(s).
interface Promise<T>
var Promise: PromiseConstructor
Represents the completion of an asynchronous operation

Need to add <any> next to Promise.

@awwong1
Copy link
Contributor

awwong1 commented Mar 23, 2018

Thanks for merging this in! I added in some code in that PR as a comment.
I think you should be able to close this issue once you create a new release.

@mrbar42
Copy link
Owner

mrbar42 commented Mar 24, 2018

should be fixed in v0.3.1 🎉

please reopen if needed

@mrbar42 mrbar42 closed this as completed Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants