-
Notifications
You must be signed in to change notification settings - Fork 726
Improve typings #813
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
Improve typings #813
Conversation
LGTM |
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
The ApiResponse now accepts a generics that defaults to any, same for every API method that might need a body.
details: Explanation[]; | ||
} | ||
|
||
interface SearchResponse<T> { |
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'm wondering, why can't this part be exported by this client library directly? This seems generic enough.
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.
Because there is not an official spec from which I can generate the response types, and it will make no sense export the types just for the search response.
} | ||
} | ||
|
||
// Define the intefrace of the source object |
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.
"interface", not "intefrace" ;)
Shouldn't
|
With this change, it's now easier to use TypeScript with the client.
The ApiResponse now accepts a generics that defaults to
any
, same for every API method that might need a body.The documentation has been updated accordingly.
I would like to thank @fox1t for the suggestions :)