-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
55 lines (47 loc) · 1.28 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
53
54
55
export function createClient(options: CreateClientOptions): GoogleMapsClient;
export interface CreateClientOptions {
/**
* API key (required, unless clientID and clientSecret provided).
*/
key: string,
clientId?: string,
clientSecret?: string,
channel?: string,
timeout?: number,
language?: string,
rate?: {
limit?: number,
period?: number,
},
retryOptions?: {
interval?: number,
},
Promise?: PromiseConstructor,
}
export interface RequestHandle {
asPromise: any,
}
export interface GoogleMapsClient {
geocode: ApiMethod<{
address?: string,
components?: object,
bounds?: { southwest: LatLng, northeast: LatLng },
region?: string,
language?: string,
}>,
}
export type ApiMethod<Query> = (query: Query, callback?: ResponseCallback) => RequestHandle;
export interface Query {
address: string;
}
export type ResponseCallback = (err: Error, response: ClientResponse) => void;
export interface ClientResponse {
headers: object,
json: object,
status: number,
}
export type LatLng = [number, number] | string | { lat: any, lng: any } | { latitude: any, longitude: any };
export namespace cli {
export function parseArgs(argv: string[]): { [key: string]: any }
export function callback(error: Error, response: { json: any }): void
}