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

v4 alpha: Add full test coverage for TypeScript hook types & fix missing overloads #895

Merged
merged 4 commits into from
Jan 10, 2020

Conversation

bbugh
Copy link
Contributor

@bbugh bbugh commented Dec 22, 2019

There are currently a lot of TypeScript edge cases in v4 alpha where calling function with certain signatures would not strictly type the expected arguments, or would result in any being part of the return types. This was caused by missing overloads for the hooks that determined types by how they were called.

This PR intentionally does not change any behavior, it only adds type coverage and tests.

  • adds the missingTypeScript function overloads for all hooks, so that calling with the different arguments results in correct types both for inputs and outputs
  • adds (almost) complete coverage for types, excepting excepting the cases where strict is required, or where a failure is expected, which TypeScript does not currently support.

bbugh and others added 4 commits December 22, 2019 07:49
There were a lot of TypeScript edge cases, where calling functions with
certain argument options would result in `any` being expressed as a
type, or where the variables/options were not strictly requiring the
desired inputs.

This adds TypeScript function overloads for all hook edge cases so that
all types are correct. This does not change any behavior.

This also adds almost complete coverage for types, excepting the cases
where `strict` is required, or where a failure is expected, which
TypeScript does not currently support. See:
microsoft/TypeScript#29394
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.

2 participants