forked from marlove/react-native-geocoding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
52 lines (49 loc) · 1.12 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
declare namespace Geocoder {
interface LatLng {
lat: number;
lng: number;
}
interface PlusCode {
compound_code: string;
global_code: string;
}
interface GeocoderResponse {
plus_code: PlusCode;
results: {
address_components: {
long_name: string;
short_name: string;
types: string[];
}[];
formatted_address: string;
geometry: {
bounds: {
northeast: LatLng;
southwest: LatLng;
};
location: LatLng;
location_type: 'APPROXIMATE' | 'ROOFTOP' | string;
viewport: {
northeast: LatLng;
southwest: LatLng;
};
};
place_id: string;
types: string[];
plus_code: PlusCode;
}[];
status: 'OK' | string;
}
type fromParams =
| number
| number[]
| LatLng
| { latitude: number; longitude: number }
| string;
function init(apiKey: string, options?: Object): void;
function isInit(): boolean;
function from(...params: fromParams[]): Promise<GeocoderResponse>;
}
declare module 'react-native-geocoding' {
export default Geocoder;
}