From 3177388e4621a16c0859154a7ec4bea970406e55 Mon Sep 17 00:00:00 2001 From: awmack Date: Tue, 7 May 2024 17:07:33 -0700 Subject: [PATCH] fix: un-shim Maps JS types and use new published typings PiperOrigin-RevId: 631596386 --- src/utils/googlemaps_types.ts | 47 +++++------------------------------ 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/src/utils/googlemaps_types.ts b/src/utils/googlemaps_types.ts index 4b10fc9..2507224 100644 --- a/src/utils/googlemaps_types.ts +++ b/src/utils/googlemaps_types.ts @@ -10,52 +10,17 @@ */ /** Attribution object for Place photos and reviews. */ -export declare interface AuthorAttribution { - displayName: string; - photoURI: string|null; - uri: string|null; -} +export type AuthorAttribution = google.maps.places.AuthorAttribution; /** Place Photo object. */ -export declare type Photo = Omit& { - authorAttributions: AuthorAttribution[]; -}; +export type Photo = google.maps.places.Photo; /** Place Review object. */ -export declare type Review = - Omit& { - authorAttribution: AuthorAttribution|null; -}; - -/** Search by text request. */ -export declare interface SearchByTextRequest { - textQuery: string; - fields: string[]; - locationBias?: LatLng|LatLngLiteral|LatLngBounds|LatLngBoundsLiteral; - locationRestriction?: LatLngBounds|LatLngBoundsLiteral; - includedType?: string; - region?: string; -} +export type Review = google.maps.places.Review -/** Updated Place class with new attribution schema. */ -export declare interface Place extends Omit< - google.maps.places.Place, - 'photos'|'reviews'|'fetchFields'|'accessibilityOptions'> { - photos?: Photo[]; - reviews?: Review[]; - accessibilityOptions?: {hasWheelchairAccessibleEntrance: boolean|null}|null; - fetchFields: (options: google.maps.places.FetchFieldsRequest) => - Promise<{place: Place}>; -} - -/** Places library. */ -export declare interface PlacesLibrary extends - Omit { - Place: { - new(options: google.maps.places.PlaceOptions): Place; - searchByText: (request: SearchByTextRequest) => Promise<{places: Place[]}>; - }; -} +export type SearchByTextRequest = google.maps.places.SearchByTextRequest; +export type Place = google.maps.places.Place; +export type PlacesLibrary = google.maps.PlacesLibrary; /** google.maps.marker.AdvancedMarkerElement. */ export type AdvancedMarkerElement = google.maps.marker.AdvancedMarkerElement;