googlemaps / google-maps-services-js

Node.js client library for Google Maps API Web Services
Apache License 2.0
2.89k stars 639 forks source link

Directions: Missing type "google.maps.DirectionsStatus" in "google.maps.DirectionsResult" OS:W11 Pro #1173

Open DarkNasuada opened 7 months ago

DarkNasuada commented 7 months ago

Property google.maps.DirectionsStatus is missing in the type google.maps.DirectionsResult

when i console.log the result it is in the object.

using latest version of @types/google.maps

const result = await DirectionsService.route(request)

//result.status throws typescript error:  Property 'status' does not exist on type 'DirectionsResult'.ts(2339)
if (result.status === 'OK') {
     DirectionsRenderer.setDirections(result)
}

Solution:

add following line:

status: google.maps.DirectionsStatus;

in the exported interface DirectionsResult (Line 1033 in index.d.ts)

wangela commented 7 months ago

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.

@DarkNasuada Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.