API responses now support generics that allow you to specify the shape of the expected response and prevent the use of type guards to ensure specific properties exist on a given API response
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
Lots of :? in the API response interface, which leads to a lot of undefined checks that don't need to be there when we know what shape the response really has.
What is the new behavior (if this is a feature change)?
API responses now support generics that allow you to specify the shape of the expected response and prevent the use of type guards to ensure specific properties exist on a given API response. Also some other smaller housekeeping things such as throwing errors for missing config params, and a helper error class to help give useful error messages.
API responses now support generics that allow you to specify the shape of the expected response and prevent the use of type guards to ensure specific properties exist on a given API response
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) Feature
What is the current behavior? (You can also link to an open issue here) Lots of
:?
in the API response interface, which leads to a lot ofundefined
checks that don't need to be there when we know what shape the response really has.What is the new behavior (if this is a feature change)? API responses now support generics that allow you to specify the shape of the expected response and prevent the use of type guards to ensure specific properties exist on a given API response. Also some other smaller housekeeping things such as throwing errors for missing config params, and a helper error class to help give useful error messages.