npm-api icon indicating copy to clipboard operation
npm-api copied to clipboard

TypeScript typings

Open muuvmuuv opened this issue 6 years ago • 4 comments

Came across this project because I had to access NPM api with simple hooks but I'm using TypeScript and get typing errors. Would be great if you could create a typings file for those who include it in there TypeScript projects.

muuvmuuv avatar Jun 27 '19 13:06 muuvmuuv

If you'd like to do a PR to add a TypeScript definitions file that would be appreciated!

doowb avatar Jun 27 '19 15:06 doowb

I'm taking a stab at it. Some questions:

  1. NpmApi.use and NpmApi.reset don't use the _privatemethod naming convention, but aren't mentioned in the docs. Are these methods intended for external use?
  2. What is the expected type of options in NpmApi's constructor? As far as I can tell, these options are only used when calling the function returned from calling lib/plugins/downloads. But this function has 0 arguments.

mpiroc avatar May 09 '20 21:05 mpiroc

Here's an initial attempt. I'm going to try it in my own project for a bit before submitting a PR to this repo.

https://github.com/mpiroc/npm-api/pull/1

mpiroc avatar May 09 '20 21:05 mpiroc

still alive ? it would be great to implement this : / ...

c0ncentus avatar Aug 28 '21 21:08 c0ncentus