Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#44812 googlemaps: Add fields to PlaceRevie…
Browse files Browse the repository at this point in the history
…w by @jameskeiger

* Add fields to PlaceReview object

* Delint

* Delint2
  • Loading branch information
jameskeiger authored and jjballano-qatium committed Jun 16, 2020
1 parent 7aed685 commit 09cb0d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions types/googlemaps/googlemaps-tests.ts
Expand Up @@ -713,6 +713,10 @@ service.getDetails(
}

result.name; // $ExpectType string
result.reviews; // $ExpectType PlaceReview[] | undefined
if (result.reviews && result.reviews.length) {
result.reviews[0].rating; // $ExpectType number
}
},
);

Expand Down
7 changes: 6 additions & 1 deletion types/googlemaps/reference/places-service.d.ts
Expand Up @@ -197,8 +197,13 @@ declare namespace google.maps.places {
interface PlaceReview {
aspects: PlaceAspectRating[];
author_name: string;
author_url: string;
author_url?: string;
language: string;
profile_photo_url: string;
// TODO rating is documented in the HTTP API (https://developers.google.com/places/web-service/details#PlaceDetailsResults) but not in the Javascript API.
rating: number;
relative_time_description: string;
text: string;
time: number;
}
}

0 comments on commit 09cb0d9

Please sign in to comment.