Skip to content

Add type definitions for bottleneck/light#160

Merged
SGrondin merged 1 commit intoSGrondin:masterfrom
copperwall:add-light-types
Jul 21, 2020
Merged

Add type definitions for bottleneck/light#160
SGrondin merged 1 commit intoSGrondin:masterfrom
copperwall:add-light-types

Conversation

@copperwall
Copy link
Copy Markdown
Contributor

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 octokit/plugin-retry.js#110, but I'm open to suggestions if there's a better way to do this!

Copy link
Copy Markdown

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me 👍🏼

@SGrondin SGrondin merged commit b835283 into SGrondin:master Jul 21, 2020
@SGrondin
Copy link
Copy Markdown
Owner

I'll make a new release tonight

@gr2m
Copy link
Copy Markdown

gr2m commented Jul 28, 2020

Hey Simon, could you do the release please?

@oscard0m
Copy link
Copy Markdown

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
Copy link
Copy Markdown

gr2m commented Jun 2, 2023

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

lmk123 added a commit to hcfyapp/bottleneck that referenced this pull request Jun 26, 2025
@lmk123
Copy link
Copy Markdown

lmk123 commented Jun 26, 2025

I merged this PR into my fork and published it to npm.

npm: https://www.npmjs.com/package/@hcfy/bottleneck

Source code: https://github.com/hcfyapp/bottleneck

Install:

npm i @hcfy/bottleneck

Then import:

import Bottleneck from '@hcfy/bottleneck/light'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants