ethanent / phin

Node HTTP client
MIT License
576 stars 33 forks source link

Type definitions not bundled with the release (3.4.0) #45

Closed paaskus closed 5 years ago

paaskus commented 5 years ago

Type definitions for TypeScript seems to not be bundled with the 3.4.0 release on npm.

Encountered this issue by installing phin@3.4.0 in a TypeScript (v3.6.4) project and receiving the error:

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

The thing is, the @types/phin package is just a stub since it's expected that phin provides it's own type definitions. But when I inspect node_modules/phin it indeed seems like there is no types.d.ts file.

DonovanDMC commented 5 years ago

This is really annoying now since I'm used to types, yet they aren't there anymore, so it doesn't show anything when I try to use phin. It just uses any

DonovanDMC commented 5 years ago

If you specifically install @types/phin version 3.3.0, you can still get types. But that's really annoying. ex: npm i -D @types/phin@3.3.0

ethanent commented 5 years ago

Ok, thanks for the heads up. Will look into it soon. :)

ethanent commented 5 years ago

Issue is resolved by fafe3cc5c4a6837507c91fab77d9e814a80bb841 (v 3.4.1, now published)

Thanks. Be sure to submit a PR if type definitions have any issues.