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

TypeScript definitions #1670

Closed
paulmelnikow opened this issue Aug 15, 2019 · 6 comments
Closed

TypeScript definitions #1670

paulmelnikow opened this issue Aug 15, 2019 · 6 comments
Labels
released TypeScript Anything related to TypeScript

Comments

@paulmelnikow
Copy link
Member

In working on the release notes, I realize a lot of the documentation involves being very specific about all the different overloads we support.

For TypeScript users – and indeed many non-TS users whose editors interpret the TypeScript defs – the type definitions will be the most useful way to understand how to use the functions.

I'd like to propose that we bring the type definitions in house and maintain them in this repository. This should make it easier to keep the types in sync with the API as it changes, increases the likelihood that the types are correct, and lets use ship up-to-date types in unreleased branches (e.g. future beta branches).

As TypeScript has become really common, I think it's reasonable to consider it a core part of the library's use case, rather than a fringe part.

@mastermatt
Copy link
Member

As a dev who uses nock with TS almost exclusively, I would be a fan of this decision.

I'm one of the "owners" of the types currently in DT, and I've gone through the process of migrating and decommissioning DT types before, so I'd be happy to work on this.

relates to: #1589

@paulmelnikow
Copy link
Member Author

That sounds awesome! Go for it!

mastermatt added a commit to mastermatt/nock that referenced this issue Aug 17, 2019
Fixes: nock#1670

Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0
mastermatt added a commit that referenced this issue Aug 20, 2019
Fixes: #1670

Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0

Remove `getTotalDelay` and `shouldPersist`, as they're considered private.
@nockbot
Copy link
Collaborator

nockbot commented Aug 20, 2019

🎉 This issue has been resolved in version 11.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

gr2m pushed a commit that referenced this issue Sep 4, 2019
Fixes: #1670

Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0

Remove `getTotalDelay` and `shouldPersist`, as they're considered private.
gr2m pushed a commit that referenced this issue Sep 4, 2019
Fixes: #1670

Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0

Remove `getTotalDelay` and `shouldPersist`, as they're considered private.
gr2m pushed a commit that referenced this issue Sep 5, 2019
Fixes: #1670

Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0

Remove `getTotalDelay` and `shouldPersist`, as they're considered private.
@mastermatt mastermatt added the TypeScript Anything related to TypeScript label Sep 19, 2019
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Nov 18, 2019
- Types are included as of nock@11.3
- nock/nock#1670
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Nov 19, 2019
- Types are included as of nock@11.3
- nock/nock#1670
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Nov 19, 2019
- Types are included as of nock@11.3
- nock/nock#1670
mikeharder added a commit to Azure/azure-sdk-for-js that referenced this issue Nov 19, 2019
- Types are included as of nock@11.3
- nock/nock#1670
mikeharder added a commit to mikeharder/azure-sdk-for-js that referenced this issue Dec 6, 2019
- dotenv
  - Types are included as of 8.2.0
  - motdotla/dotenv#430
- execa
  - Types are included as of 2.0.0
  - sindresorhus/execa#188
- nock
  - Types are included as of 11.3
  - nock/nock#1670
mikeharder added a commit to Azure/azure-sdk-for-js that referenced this issue Dec 9, 2019
- dotenv
  - Types are included as of 8.2.0
  - motdotla/dotenv#430
- execa
  - Types are included as of 2.0.0
  - sindresorhus/execa#188
- nock
  - Types are included as of 11.3
  - nock/nock#1670
@nyngwang
Copy link

Do I have to import something more or just import nock from 'nock' to facilitate those type definitions?

@mastermatt
Copy link
Member

import nock from 'nock' is all it takes.

@nyngwang
Copy link

@mastermatt Great thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released TypeScript Anything related to TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants