google-maps-services-js
google-maps-services-js copied to clipboard
Refine typings for `AutocompleteRequest.types` to allow for all variations allowed by the API
Issue description
In the documentation for the placeAutocomplete method it is said that it supports
separated by a vertical bar | as a valid value for the types parameter of the autocomplete endpoint.
However, in places/autocomplete.ts the type of the types property is an enum PlaceAutocompleteType, which supports a very limited set of types/filters for this API, which makes it impossible to use the method with the values from the aforementioned tables without tricking TypeScript with as unknown as PlaceAutocompleteType cast.
This contradicts the documentation of the endpoint, makes it impossible to use singular or combined values from the aforementioned tables and limits the capabilities of the autocompletion.
Suggestion
If these capabilities of filtering by types are not to be deprecated by Google Maps API itself, I would suggest changing the type of types field to string to reach parity in filtering autocompletion predictions between raw API calls and this library.
I would also appreciate if anybody could suggest me another way to, for example, send { types: 'postal_code' }, if there is one in this library and I'm not aware of it. It is supported in raw API calls and I see no reason why it should not be supported in the library.
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@amelekhin 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.