Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typescript types #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed typescript types #32

wants to merge 1 commit into from

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