Skip to content

Commit

Permalink
fix: definition
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jul 14, 2022
1 parent 54a86d1 commit ed1fc6d
Showing 1 changed file with 44 additions and 10 deletions.
54 changes: 44 additions & 10 deletions src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface Adress {
latitude: string
longitude: string
latitude: number
longitude: number
countryCode: string
postalCode: string
administrativeArea: string
Expand All @@ -13,22 +13,56 @@ export interface Adress {
formatted_address: string
}

export interface ForwardOptions {
addressString: string
export interface baseOption {
/*
* Localise the results to the given locale.
*/
useLocale?: boolean
/*
* locale is a string in the format of language_country, for example en_US.
*/
defaultLocale?: string
/*
* Max number of results to return.
*/
maxResults?: number
/*
* Only used for web platform to use google api
*/
apiKey?: string
}
export interface reverseOptions {
latitude: number
export interface ForwardOptions extends baseOption {
/*
* address is a string of the address to be geocoded.
*/
addressString: string
}
export interface reverseOptions extends baseOption {
/*
* latitude is a number representing the latitude of the location.
*/
latitude: number
/*
* longitude is a number representing the longitude of the location.
*/
longitude: number
useLocale?: boolean
defaultLocale?: string
maxResults?: number
apiKey?: string
}
export interface NativeGeocoderPlugin {
/*
* Convert latitude and longitude to an address
*
* @param id The bundle id to delete (note, this is the bundle id, NOT the version name)
* @returns {Promise<{addresses: Adress[]}>} an Promise with the list of addresses according to maxResults
* @throws An error if the something went wrong
* @since 0.0.1
*/
reverseGeocode(options: reverseOptions): Promise<{ addresses: Adress[] }>;
/*
* Convert an address to latitude and longitude
*
* @returns {Promise<{addresses: Adress[]}>} an Promise with the list of addresses according to maxResults
* @throws An error if the something went wrong
* @since 0.0.1
*/
forwardGeocode(options: ForwardOptions): Promise<{ addresses: Adress[] }>;
}

0 comments on commit ed1fc6d

Please sign in to comment.