SGrondin / bottleneck

Job scheduler and rate limiter, supports Clustering
MIT License
1.83k stars 79 forks source link

Add type definitions for bottleneck/light #160

Closed copperwall closed 4 years ago

copperwall commented 4 years ago

Hey there, octokit/plugin-retry.js uses bottleneck/light for ratelimiting, but there's a little bit of trouble importing types when using bottleneck/light over the main bottleneck import.

I did some testing and adding a light.d.ts definition file with existing namespace and class types but under a bottleneck/light module lets typescript find the types for the light import.

I noticed that the existing type definitions were using EJS templates, so I move the namespace and class type definitions to a shared EJS template and included that in both the bottleneck.d.ts.ejs and light.d.ts.ejs template files.

This fixes the issue in https://github.com/octokit/plugin-retry.js/pull/110, but I'm open to suggestions if there's a better way to do this!

SGrondin commented 4 years ago

I'll make a new release tonight

gr2m commented 4 years ago

Hey Simon, could you do the release please?

oscard0m commented 2 years ago

Hi @SGrondin, I was walking through existing open issues in Octokit and I arrived to an issue which depends on these changes to be released, what's the status of bottleneck project? Can we help you with something?

Thanks for your time and please let us know if you need help.

gr2m commented 1 year ago

@SGrondin it looks like there is still no new release. Could you please do a new release that includes this fix?