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
feat(types): Add Typescript definitions. #1676
Conversation
Fixes: nock#1670 Copies over the existing types and tests from DefinitelyTyped. Includes updates to bring them up to date with 11.0
Wow, this looks great! I want to look through this a bit. There are a few methods in here that I think are not documented and therefore I’d consider internal, and I think there’s a conflict between what’s here and in the release notes for It’s exciting to have these included here! |
There are two methods which I think are internal and should be removed:
Do you agree? |
I have some suggested edits. I moved one type before its first use, and tweaked some naming. The idea is to reserve "callback" for a Node-style callback and use I'm pushing the edits to this branch for the sake of simplicity, though if you prefer to do something else, feel free to revert of edit further. |
I'm fine with removing those two fns. Neither are documented. The naming changes look good, however, the order of the |
Marked as private in jsdoc strings.
# Conflicts: # package-lock.json
I've made those changes. This is ready for review again. |
) => ReplyBody | Promise<ReplyBody>, | ||
headers?: ReplyHeaders | ||
): Scope | ||
reply(responseCode?: StatusCode, body?: Body, headers?: ReplyHeaders): Scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if we accept e.g. .reply(undefined, "foobar")
as this indicates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to double check, but yes. That would work and result in the status code defaulting to 200.
🎉 This PR is included in version 11.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is amazing! 🎉 |
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.
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.
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.
Fixes: #1670
Copies over the existing types and tests from DefinitelyTyped.
Includes updates to bring them up to date with 11.0