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

Export GotRequestMethod TypeScript type #1017

Merged
merged 13 commits into from
Jan 24, 2020
Merged

Export GotRequestMethod TypeScript type #1017

merged 13 commits into from
Jan 24, 2020

Conversation

mrhyde
Copy link
Contributor

@mrhyde mrhyde commented Jan 9, 2020

At this moment to be able to correctly define got methods as dependencies we need to import the module into type declaration files

import got from 'got'

interface Dependencies {
  readonly get: typeof got.get
}

with introduced changes we can simply do as so:

import { GotFunctions } from 'got'

interface Dependencies {
  readonly get: GotFunctions
}

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.

@mrhyde
Copy link
Contributor Author

mrhyde commented Jan 9, 2020

Failed tests are not related to this PR

@sindresorhus
Copy link
Owner

I don't think GotFunctions is a good name to expose (I do realize we named it). I should be singular. Maybe something like GotRequestMethod? And it needs a doc comment so users would know what it's for.

@mrhyde
Copy link
Contributor Author

mrhyde commented Jan 16, 2020

GotRequestMethod sounds good to me, I'll update this PR tomorrow along with docs

@mrhyde
Copy link
Contributor Author

mrhyde commented Jan 18, 2020

@sindresorhus let me know if readme section is ok

readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
Co-Authored-By: Szymon Marczak <36894700+szmarczak@users.noreply.github.com>
@mrhyde
Copy link
Contributor Author

mrhyde commented Jan 23, 2020

@sindresorhus all issues mentioned above should be resolved

readme.md Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title Export GotFunctions interface Export GotRequestMethod TypeScript type Jan 24, 2020
@sindresorhus sindresorhus merged commit f02694e into sindresorhus:master Jan 24, 2020
@sindresorhus
Copy link
Owner

Thanks :)

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.

3 participants