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

update typescript generation to work in strict mode #345

Merged
merged 1 commit into from
Nov 5, 2018

Conversation

henriiik
Copy link
Contributor

The changes in this PR fixes the issues brought up in #279.

The problem is that in typescripts strict mode, the type {} only matches empty objects ex const someVar = {}, and not anything else.

The following changes are made:

  1. update tsconfig.json to use strict
  2. update MethodInfo/AbstractClientBase/ClientReadableStream to be generic over Request and Response types
  3. update ClientReadableStream.on to have correct callback type depending on type argument
  4. update generated clients to allow passing of null as credentials and options

I could not figure out where credentials and options are used so I could not figure out the correct types. If you could point me in the right direction that would be great! :)

stanley-cheung
stanley-cheung previously approved these changes Nov 1, 2018
Copy link
Collaborator

@stanley-cheung stanley-cheung left a comment

Choose a reason for hiding this comment

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

Sorry for the late reply. Thanks very much for the contribution! TypeScript help is sorely needed right now!

credentials and options should both be an object of string: string, but they are both unused right now.

@henriiik
Copy link
Contributor Author

henriiik commented Nov 4, 2018

Thanks for the info @stanley-cheung 🙂

I have updated the PR with the correct types for credentials and options and it should be good to merge now.

Copy link
Collaborator

@stanley-cheung stanley-cheung left a comment

Choose a reason for hiding this comment

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

Thanks for your contributions!

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

Successfully merging this pull request may close these issues.

None yet

3 participants