Skip to content

Conversation

snaquaye
Copy link

No description provided.

from(...params: any[]): Promise<void>;
getFromLocation(address: string): Promise<any>;
getFromLatLng(lat: number, lng: number): Promise<any>;
static init(apiKey: string, options: Object): void;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snaquaye shouldn't options be optional ? like in the docs
static init(apiKey: string, options?: Object): void;

init(apiKey: string, options: Object): void;
isInit(): boolean;
setApiKey(API_KEY: string): void;
from(...params: any[]): Promise<void>;
Copy link

@iamjon iamjon Aug 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from doesn't return void, it returns a google geocoding response like so
https://developers.google.com/maps/documentation/geocoding/overview#GeocodingResponses or it throws an error.

What I did locally was create an interface that contains the geocoding response like so
interface geocodingResponse { plus_code: {compound_code: string, global_code: string} results: Array; status: string; }

and changed the declartion to:
static from(...params: any[]): Promise<geocodingResponse>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants