google-maps-services-js
google-maps-services-js copied to clipboard
TypeScript error in Request interfaces
Now request interfaces like DistanceMatrixRequest, GeocodeRequest extends AxiosRequestConfig which has params (type: any).
In my case I just want to omit key from request params because we set key globally, so I defined following interface.
interface IKeyOmittedGeocodeRequest extends Omit<GeocodeRequest, 'params'> {
params: Omit<Pick<GeocodeRequest, 'params'>, 'key'>;
}
But as GeocodeRequest extends AxiosRequestConfig which has params, TypeScript recognizes params in IKeyOmittedGoecodeRequest from AxiosRequestConfig which is any.
And it doesn't recognize request.params.destinations.
I think all request interfaces should inherit Omit<Partial<AxiosRequestConfig>, 'params'>
If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.
@StanislavHT Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.