google-maps-fetch 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +258 -2
- package/compat/package.json +5 -0
- package/dist/chunk-DU6WHR7R.cjs +246 -0
- package/dist/chunk-KSK2WERM.js +246 -0
- package/dist/compat.cjs +1215 -0
- package/dist/compat.d.cts +786 -0
- package/dist/compat.d.ts +786 -0
- package/dist/compat.js +1215 -0
- package/dist/index.cjs +127 -0
- package/dist/index.d.cts +108 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +127 -0
- package/dist/types-FNou8i90.d.cts +629 -0
- package/dist/types-FNou8i90.d.ts +629 -0
- package/package.json +92 -4
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
interface ClientOptions {
|
|
3
|
+
/** Google Maps Platform API key */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Defaults to the global fetch */
|
|
6
|
+
fetch?: FetchLike;
|
|
7
|
+
/** Milliseconds before a single attempt is abandoned. Default 10000; 0 waits as long as it takes */
|
|
8
|
+
timeout?: number;
|
|
9
|
+
/** Extra attempts after a network error, timeout, 429 or 5xx. Default 2 */
|
|
10
|
+
retries?: number;
|
|
11
|
+
/** Sent with every request */
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
interface CallOptions {
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
/** Overrides the client's timeout for this call; 0 waits as long as it takes */
|
|
17
|
+
timeout?: number;
|
|
18
|
+
}
|
|
19
|
+
interface FieldOptions extends CallOptions {
|
|
20
|
+
/** Field mask: which fields Google returns, and so which billing tier you pay for */
|
|
21
|
+
fields?: string | string[];
|
|
22
|
+
}
|
|
23
|
+
declare class MapsError extends Error {
|
|
24
|
+
/** HTTP status, or 0 when no response arrived */
|
|
25
|
+
readonly status: number;
|
|
26
|
+
/** Google's error status, e.g. INVALID_ARGUMENT or REQUEST_DENIED, or TIMEOUT / NETWORK_ERROR */
|
|
27
|
+
readonly code: string;
|
|
28
|
+
/** The response body, if there was one */
|
|
29
|
+
readonly body?: unknown | undefined;
|
|
30
|
+
name: string;
|
|
31
|
+
constructor(message: string,
|
|
32
|
+
/** HTTP status, or 0 when no response arrived */
|
|
33
|
+
status: number,
|
|
34
|
+
/** Google's error status, e.g. INVALID_ARGUMENT or REQUEST_DENIED, or TIMEOUT / NETWORK_ERROR */
|
|
35
|
+
code: string,
|
|
36
|
+
/** The response body, if there was one */
|
|
37
|
+
body?: unknown | undefined);
|
|
38
|
+
/** Same shape as an axios error's response, for code written against axios-based clients */
|
|
39
|
+
get response(): {
|
|
40
|
+
status: number;
|
|
41
|
+
data: unknown;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}
|
|
44
|
+
interface Request {
|
|
45
|
+
method: 'GET' | 'POST';
|
|
46
|
+
url: string;
|
|
47
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
48
|
+
body?: unknown;
|
|
49
|
+
fields?: string | string[];
|
|
50
|
+
/** v1 APIs take the key in a header; the older JSON APIs take it in the query string */
|
|
51
|
+
keyIn?: 'header' | 'query';
|
|
52
|
+
}
|
|
53
|
+
type Send = <T>(request: Request, call?: CallOptions) => Promise<T>;
|
|
54
|
+
|
|
55
|
+
interface LatLng {
|
|
56
|
+
latitude: number;
|
|
57
|
+
longitude: number;
|
|
58
|
+
}
|
|
59
|
+
/** Coordinates in any common shape: { latitude, longitude }, { lat, lng } or [lat, lng] */
|
|
60
|
+
type LatLngInput = LatLng | {
|
|
61
|
+
lat: number;
|
|
62
|
+
lng: number;
|
|
63
|
+
} | [number, number];
|
|
64
|
+
interface Circle {
|
|
65
|
+
center: LatLng;
|
|
66
|
+
/** Metres */
|
|
67
|
+
radius: number;
|
|
68
|
+
}
|
|
69
|
+
interface Viewport {
|
|
70
|
+
low: LatLng;
|
|
71
|
+
high: LatLng;
|
|
72
|
+
}
|
|
73
|
+
type Area = {
|
|
74
|
+
circle: Circle;
|
|
75
|
+
} | {
|
|
76
|
+
rectangle: Viewport;
|
|
77
|
+
};
|
|
78
|
+
interface LocalizedText {
|
|
79
|
+
text: string;
|
|
80
|
+
languageCode?: string;
|
|
81
|
+
}
|
|
82
|
+
interface StringRange {
|
|
83
|
+
/** Omitted by Google when it is 0 */
|
|
84
|
+
startOffset?: number;
|
|
85
|
+
endOffset: number;
|
|
86
|
+
}
|
|
87
|
+
interface FormattableText {
|
|
88
|
+
text: string;
|
|
89
|
+
matches?: StringRange[];
|
|
90
|
+
}
|
|
91
|
+
interface StructuredFormat {
|
|
92
|
+
mainText: FormattableText;
|
|
93
|
+
secondaryText?: FormattableText;
|
|
94
|
+
}
|
|
95
|
+
interface PlacePrediction {
|
|
96
|
+
/** Resource name, "places/{placeId}" */
|
|
97
|
+
place: string;
|
|
98
|
+
placeId: string;
|
|
99
|
+
text: FormattableText;
|
|
100
|
+
structuredFormat?: StructuredFormat;
|
|
101
|
+
types?: string[];
|
|
102
|
+
distanceMeters?: number;
|
|
103
|
+
}
|
|
104
|
+
interface QueryPrediction {
|
|
105
|
+
text: FormattableText;
|
|
106
|
+
structuredFormat?: StructuredFormat;
|
|
107
|
+
}
|
|
108
|
+
interface Suggestion {
|
|
109
|
+
placePrediction?: PlacePrediction;
|
|
110
|
+
queryPrediction?: QueryPrediction;
|
|
111
|
+
}
|
|
112
|
+
interface AutocompleteRequest {
|
|
113
|
+
input: string;
|
|
114
|
+
locationBias?: Area;
|
|
115
|
+
locationRestriction?: Area;
|
|
116
|
+
/** Up to 5 primary types, or only "(regions)", or only "(cities)" */
|
|
117
|
+
includedPrimaryTypes?: string[];
|
|
118
|
+
/** Up to 15 two-letter region codes */
|
|
119
|
+
includedRegionCodes?: string[];
|
|
120
|
+
languageCode?: string;
|
|
121
|
+
regionCode?: string;
|
|
122
|
+
origin?: LatLng;
|
|
123
|
+
inputOffset?: number;
|
|
124
|
+
includeQueryPredictions?: boolean;
|
|
125
|
+
sessionToken?: string;
|
|
126
|
+
includePureServiceAreaBusinesses?: boolean;
|
|
127
|
+
[field: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
interface AutocompleteResponse {
|
|
130
|
+
suggestions?: Suggestion[];
|
|
131
|
+
}
|
|
132
|
+
interface AddressComponent {
|
|
133
|
+
longText: string;
|
|
134
|
+
shortText: string;
|
|
135
|
+
types: string[];
|
|
136
|
+
languageCode?: string;
|
|
137
|
+
}
|
|
138
|
+
interface Photo {
|
|
139
|
+
/** Resource name, "places/{placeId}/photos/{photo}" */
|
|
140
|
+
name: string;
|
|
141
|
+
widthPx: number;
|
|
142
|
+
heightPx: number;
|
|
143
|
+
authorAttributions?: {
|
|
144
|
+
displayName: string;
|
|
145
|
+
uri?: string;
|
|
146
|
+
photoUri?: string;
|
|
147
|
+
}[];
|
|
148
|
+
}
|
|
149
|
+
interface OpeningHours {
|
|
150
|
+
openNow?: boolean;
|
|
151
|
+
periods?: {
|
|
152
|
+
open: {
|
|
153
|
+
day: number;
|
|
154
|
+
hour: number;
|
|
155
|
+
minute: number;
|
|
156
|
+
};
|
|
157
|
+
close?: {
|
|
158
|
+
day: number;
|
|
159
|
+
hour: number;
|
|
160
|
+
minute: number;
|
|
161
|
+
};
|
|
162
|
+
}[];
|
|
163
|
+
weekdayDescriptions?: string[];
|
|
164
|
+
}
|
|
165
|
+
interface Review {
|
|
166
|
+
rating?: number;
|
|
167
|
+
text?: LocalizedText;
|
|
168
|
+
originalText?: LocalizedText;
|
|
169
|
+
relativePublishTimeDescription?: string;
|
|
170
|
+
publishTime?: string;
|
|
171
|
+
authorAttribution?: {
|
|
172
|
+
displayName: string;
|
|
173
|
+
uri?: string;
|
|
174
|
+
photoUri?: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
interface Place {
|
|
178
|
+
/** Resource name, "places/{placeId}" */
|
|
179
|
+
name?: string;
|
|
180
|
+
id?: string;
|
|
181
|
+
displayName?: LocalizedText;
|
|
182
|
+
formattedAddress?: string;
|
|
183
|
+
shortFormattedAddress?: string;
|
|
184
|
+
adrFormatAddress?: string;
|
|
185
|
+
addressComponents?: AddressComponent[];
|
|
186
|
+
location?: LatLng;
|
|
187
|
+
viewport?: Viewport;
|
|
188
|
+
plusCode?: {
|
|
189
|
+
globalCode?: string;
|
|
190
|
+
compoundCode?: string;
|
|
191
|
+
};
|
|
192
|
+
types?: string[];
|
|
193
|
+
primaryType?: string;
|
|
194
|
+
googleMapsUri?: string;
|
|
195
|
+
websiteUri?: string;
|
|
196
|
+
nationalPhoneNumber?: string;
|
|
197
|
+
internationalPhoneNumber?: string;
|
|
198
|
+
rating?: number;
|
|
199
|
+
userRatingCount?: number;
|
|
200
|
+
/** PRICE_LEVEL_FREE ... PRICE_LEVEL_VERY_EXPENSIVE */
|
|
201
|
+
priceLevel?: string;
|
|
202
|
+
/** OPERATIONAL, CLOSED_TEMPORARILY or CLOSED_PERMANENTLY */
|
|
203
|
+
businessStatus?: string;
|
|
204
|
+
utcOffsetMinutes?: number;
|
|
205
|
+
regularOpeningHours?: OpeningHours;
|
|
206
|
+
currentOpeningHours?: OpeningHours;
|
|
207
|
+
photos?: Photo[];
|
|
208
|
+
reviews?: Review[];
|
|
209
|
+
editorialSummary?: LocalizedText;
|
|
210
|
+
iconMaskBaseUri?: string;
|
|
211
|
+
iconBackgroundColor?: string;
|
|
212
|
+
accessibilityOptions?: {
|
|
213
|
+
wheelchairAccessibleEntrance?: boolean;
|
|
214
|
+
[field: string]: unknown;
|
|
215
|
+
};
|
|
216
|
+
/** Hours for a sub-service such as DRIVE_THROUGH or DELIVERY */
|
|
217
|
+
regularSecondaryOpeningHours?: SecondaryOpeningHours[];
|
|
218
|
+
currentSecondaryOpeningHours?: SecondaryOpeningHours[];
|
|
219
|
+
[field: string]: unknown;
|
|
220
|
+
}
|
|
221
|
+
interface SecondaryOpeningHours extends OpeningHours {
|
|
222
|
+
secondaryHoursType?: string;
|
|
223
|
+
}
|
|
224
|
+
interface GetPlaceOptions {
|
|
225
|
+
languageCode?: string;
|
|
226
|
+
regionCode?: string;
|
|
227
|
+
sessionToken?: string;
|
|
228
|
+
}
|
|
229
|
+
interface SearchTextRequest {
|
|
230
|
+
textQuery: string;
|
|
231
|
+
includedType?: string;
|
|
232
|
+
strictTypeFiltering?: boolean;
|
|
233
|
+
openNow?: boolean;
|
|
234
|
+
minRating?: number;
|
|
235
|
+
priceLevels?: string[];
|
|
236
|
+
/** RELEVANCE or DISTANCE */
|
|
237
|
+
rankPreference?: string;
|
|
238
|
+
locationBias?: Area;
|
|
239
|
+
/** Only a rectangle is accepted here */
|
|
240
|
+
locationRestriction?: {
|
|
241
|
+
rectangle: Viewport;
|
|
242
|
+
};
|
|
243
|
+
/** 1 to 20 */
|
|
244
|
+
pageSize?: number;
|
|
245
|
+
pageToken?: string;
|
|
246
|
+
languageCode?: string;
|
|
247
|
+
regionCode?: string;
|
|
248
|
+
[field: string]: unknown;
|
|
249
|
+
}
|
|
250
|
+
interface SearchTextResponse {
|
|
251
|
+
places?: Place[];
|
|
252
|
+
nextPageToken?: string;
|
|
253
|
+
[field: string]: unknown;
|
|
254
|
+
}
|
|
255
|
+
interface SearchNearbyRequest {
|
|
256
|
+
locationRestriction: {
|
|
257
|
+
circle: Circle;
|
|
258
|
+
};
|
|
259
|
+
includedTypes?: string[];
|
|
260
|
+
excludedTypes?: string[];
|
|
261
|
+
includedPrimaryTypes?: string[];
|
|
262
|
+
excludedPrimaryTypes?: string[];
|
|
263
|
+
/** 1 to 20 */
|
|
264
|
+
maxResultCount?: number;
|
|
265
|
+
/** POPULARITY or DISTANCE */
|
|
266
|
+
rankPreference?: string;
|
|
267
|
+
languageCode?: string;
|
|
268
|
+
regionCode?: string;
|
|
269
|
+
[field: string]: unknown;
|
|
270
|
+
}
|
|
271
|
+
interface SearchNearbyResponse {
|
|
272
|
+
places?: Place[];
|
|
273
|
+
[field: string]: unknown;
|
|
274
|
+
}
|
|
275
|
+
interface PhotoMedia {
|
|
276
|
+
name: string;
|
|
277
|
+
/** Short-lived URL of the image */
|
|
278
|
+
photoUri: string;
|
|
279
|
+
}
|
|
280
|
+
interface Location {
|
|
281
|
+
latLng: LatLng;
|
|
282
|
+
heading?: number;
|
|
283
|
+
}
|
|
284
|
+
interface Waypoint {
|
|
285
|
+
location?: Location;
|
|
286
|
+
placeId?: string;
|
|
287
|
+
address?: string;
|
|
288
|
+
via?: boolean;
|
|
289
|
+
vehicleStopover?: boolean;
|
|
290
|
+
sideOfRoad?: boolean;
|
|
291
|
+
}
|
|
292
|
+
/** A waypoint, or a shorthand: an address string, or coordinates in any shape LatLngInput accepts */
|
|
293
|
+
type WaypointInput = Waypoint | string | LatLngInput;
|
|
294
|
+
/** DRIVE, BICYCLE, WALK, TWO_WHEELER or TRANSIT */
|
|
295
|
+
type TravelMode = 'DRIVE' | 'BICYCLE' | 'WALK' | 'TWO_WHEELER' | 'TRANSIT' | (string & {});
|
|
296
|
+
interface RouteModifiers {
|
|
297
|
+
avoidTolls?: boolean;
|
|
298
|
+
avoidHighways?: boolean;
|
|
299
|
+
avoidFerries?: boolean;
|
|
300
|
+
avoidIndoor?: boolean;
|
|
301
|
+
[field: string]: unknown;
|
|
302
|
+
}
|
|
303
|
+
interface ComputeRoutesRequest {
|
|
304
|
+
origin: WaypointInput;
|
|
305
|
+
destination: WaypointInput;
|
|
306
|
+
intermediates?: WaypointInput[];
|
|
307
|
+
travelMode?: TravelMode;
|
|
308
|
+
/** TRAFFIC_UNAWARE, TRAFFIC_AWARE or TRAFFIC_AWARE_OPTIMAL. Traffic-aware routing is billed at a higher tier. */
|
|
309
|
+
routingPreference?: string;
|
|
310
|
+
/** RFC 3339 timestamp */
|
|
311
|
+
departureTime?: string;
|
|
312
|
+
arrivalTime?: string;
|
|
313
|
+
computeAlternativeRoutes?: boolean;
|
|
314
|
+
routeModifiers?: RouteModifiers;
|
|
315
|
+
languageCode?: string;
|
|
316
|
+
regionCode?: string;
|
|
317
|
+
/** METRIC or IMPERIAL */
|
|
318
|
+
units?: string;
|
|
319
|
+
optimizeWaypointOrder?: boolean;
|
|
320
|
+
trafficModel?: string;
|
|
321
|
+
transitPreferences?: {
|
|
322
|
+
allowedTravelModes?: string[];
|
|
323
|
+
routingPreference?: string;
|
|
324
|
+
};
|
|
325
|
+
[field: string]: unknown;
|
|
326
|
+
}
|
|
327
|
+
interface Polyline {
|
|
328
|
+
encodedPolyline?: string;
|
|
329
|
+
}
|
|
330
|
+
interface LocalizedValues {
|
|
331
|
+
distance?: LocalizedText;
|
|
332
|
+
duration?: LocalizedText;
|
|
333
|
+
staticDuration?: LocalizedText;
|
|
334
|
+
}
|
|
335
|
+
interface RouteLegStep {
|
|
336
|
+
distanceMeters?: number;
|
|
337
|
+
staticDuration?: string;
|
|
338
|
+
polyline?: Polyline;
|
|
339
|
+
startLocation?: Location;
|
|
340
|
+
endLocation?: Location;
|
|
341
|
+
navigationInstruction?: {
|
|
342
|
+
maneuver?: string;
|
|
343
|
+
instructions?: string;
|
|
344
|
+
};
|
|
345
|
+
localizedValues?: LocalizedValues;
|
|
346
|
+
travelMode?: string;
|
|
347
|
+
[field: string]: unknown;
|
|
348
|
+
}
|
|
349
|
+
interface RouteLeg {
|
|
350
|
+
distanceMeters?: number;
|
|
351
|
+
/** e.g. "1234s"; includes traffic when the request was traffic-aware */
|
|
352
|
+
duration?: string;
|
|
353
|
+
/** Without traffic */
|
|
354
|
+
staticDuration?: string;
|
|
355
|
+
polyline?: Polyline;
|
|
356
|
+
startLocation?: Location;
|
|
357
|
+
endLocation?: Location;
|
|
358
|
+
steps?: RouteLegStep[];
|
|
359
|
+
localizedValues?: LocalizedValues;
|
|
360
|
+
[field: string]: unknown;
|
|
361
|
+
}
|
|
362
|
+
interface Route {
|
|
363
|
+
description?: string;
|
|
364
|
+
legs?: RouteLeg[];
|
|
365
|
+
distanceMeters?: number;
|
|
366
|
+
duration?: string;
|
|
367
|
+
staticDuration?: string;
|
|
368
|
+
polyline?: Polyline;
|
|
369
|
+
viewport?: Viewport;
|
|
370
|
+
warnings?: string[];
|
|
371
|
+
optimizedIntermediateWaypointIndex?: number[];
|
|
372
|
+
localizedValues?: LocalizedValues;
|
|
373
|
+
[field: string]: unknown;
|
|
374
|
+
}
|
|
375
|
+
interface ComputeRoutesResponse {
|
|
376
|
+
routes?: Route[];
|
|
377
|
+
[field: string]: unknown;
|
|
378
|
+
}
|
|
379
|
+
interface RouteMatrixOrigin {
|
|
380
|
+
waypoint: Waypoint;
|
|
381
|
+
routeModifiers?: RouteModifiers;
|
|
382
|
+
}
|
|
383
|
+
interface RouteMatrixDestination {
|
|
384
|
+
waypoint: Waypoint;
|
|
385
|
+
}
|
|
386
|
+
interface ComputeRouteMatrixRequest {
|
|
387
|
+
origins: (WaypointInput | RouteMatrixOrigin)[];
|
|
388
|
+
destinations: (WaypointInput | RouteMatrixDestination)[];
|
|
389
|
+
travelMode?: TravelMode;
|
|
390
|
+
routingPreference?: string;
|
|
391
|
+
departureTime?: string;
|
|
392
|
+
arrivalTime?: string;
|
|
393
|
+
languageCode?: string;
|
|
394
|
+
regionCode?: string;
|
|
395
|
+
units?: string;
|
|
396
|
+
trafficModel?: string;
|
|
397
|
+
transitPreferences?: {
|
|
398
|
+
allowedTravelModes?: string[];
|
|
399
|
+
routingPreference?: string;
|
|
400
|
+
};
|
|
401
|
+
[field: string]: unknown;
|
|
402
|
+
}
|
|
403
|
+
interface RouteMatrixElement {
|
|
404
|
+
originIndex: number;
|
|
405
|
+
destinationIndex: number;
|
|
406
|
+
status?: {
|
|
407
|
+
code?: number;
|
|
408
|
+
message?: string;
|
|
409
|
+
};
|
|
410
|
+
/** ROUTE_EXISTS or ROUTE_NOT_FOUND */
|
|
411
|
+
condition?: string;
|
|
412
|
+
distanceMeters?: number;
|
|
413
|
+
duration?: string;
|
|
414
|
+
staticDuration?: string;
|
|
415
|
+
localizedValues?: LocalizedValues;
|
|
416
|
+
[field: string]: unknown;
|
|
417
|
+
}
|
|
418
|
+
interface GeocodeResult {
|
|
419
|
+
place_id: string;
|
|
420
|
+
formatted_address: string;
|
|
421
|
+
address_components: {
|
|
422
|
+
long_name: string;
|
|
423
|
+
short_name: string;
|
|
424
|
+
types: string[];
|
|
425
|
+
}[];
|
|
426
|
+
geometry: {
|
|
427
|
+
location: {
|
|
428
|
+
lat: number;
|
|
429
|
+
lng: number;
|
|
430
|
+
};
|
|
431
|
+
location_type: string;
|
|
432
|
+
viewport: {
|
|
433
|
+
northeast: {
|
|
434
|
+
lat: number;
|
|
435
|
+
lng: number;
|
|
436
|
+
};
|
|
437
|
+
southwest: {
|
|
438
|
+
lat: number;
|
|
439
|
+
lng: number;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
bounds?: {
|
|
443
|
+
northeast: {
|
|
444
|
+
lat: number;
|
|
445
|
+
lng: number;
|
|
446
|
+
};
|
|
447
|
+
southwest: {
|
|
448
|
+
lat: number;
|
|
449
|
+
lng: number;
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
types: string[];
|
|
454
|
+
partial_match?: boolean;
|
|
455
|
+
plus_code?: {
|
|
456
|
+
global_code: string;
|
|
457
|
+
compound_code?: string;
|
|
458
|
+
};
|
|
459
|
+
[field: string]: unknown;
|
|
460
|
+
}
|
|
461
|
+
interface GeocodeRequest {
|
|
462
|
+
address?: string;
|
|
463
|
+
placeId?: string;
|
|
464
|
+
/** e.g. { country: 'IN', postal_code: '411001' } or "country:IN|postal_code:411001" */
|
|
465
|
+
components?: string | Record<string, string>;
|
|
466
|
+
bounds?: Viewport;
|
|
467
|
+
language?: string;
|
|
468
|
+
region?: string;
|
|
469
|
+
}
|
|
470
|
+
interface ReverseGeocodeRequest {
|
|
471
|
+
location: LatLngInput;
|
|
472
|
+
resultType?: string[];
|
|
473
|
+
locationType?: string[];
|
|
474
|
+
language?: string;
|
|
475
|
+
}
|
|
476
|
+
type ElevationRequest =
|
|
477
|
+
/** Up to 512 points */
|
|
478
|
+
{
|
|
479
|
+
locations: LatLngInput[];
|
|
480
|
+
}
|
|
481
|
+
/** Evenly spaced samples along a path */
|
|
482
|
+
| {
|
|
483
|
+
path: LatLngInput[];
|
|
484
|
+
samples: number;
|
|
485
|
+
};
|
|
486
|
+
interface ElevationResult {
|
|
487
|
+
/** Metres above sea level */
|
|
488
|
+
elevation: number;
|
|
489
|
+
location: {
|
|
490
|
+
lat: number;
|
|
491
|
+
lng: number;
|
|
492
|
+
};
|
|
493
|
+
/** Metres between the data points the value was interpolated from */
|
|
494
|
+
resolution?: number;
|
|
495
|
+
}
|
|
496
|
+
interface TimeZoneRequest {
|
|
497
|
+
location: LatLngInput;
|
|
498
|
+
/** When to resolve daylight saving for: a Date, or seconds since the epoch. Default now. */
|
|
499
|
+
timestamp?: Date | number;
|
|
500
|
+
language?: string;
|
|
501
|
+
}
|
|
502
|
+
interface TimeZone {
|
|
503
|
+
/** Seconds of daylight saving offset at the timestamp */
|
|
504
|
+
dstOffset: number;
|
|
505
|
+
/** Seconds from UTC, without daylight saving */
|
|
506
|
+
rawOffset: number;
|
|
507
|
+
/** IANA ID, e.g. "Asia/Kolkata" */
|
|
508
|
+
timeZoneId: string;
|
|
509
|
+
timeZoneName: string;
|
|
510
|
+
}
|
|
511
|
+
interface GeolocateRequest {
|
|
512
|
+
homeMobileCountryCode?: number;
|
|
513
|
+
homeMobileNetworkCode?: number;
|
|
514
|
+
/** gsm, cdma, wcdma, lte or nr */
|
|
515
|
+
radioType?: string;
|
|
516
|
+
carrier?: string;
|
|
517
|
+
/** Fall back to the caller's IP address. Default true; from a server that's the server's IP. */
|
|
518
|
+
considerIp?: boolean;
|
|
519
|
+
cellTowers?: {
|
|
520
|
+
cellId: number;
|
|
521
|
+
locationAreaCode?: number;
|
|
522
|
+
mobileCountryCode?: number;
|
|
523
|
+
mobileNetworkCode?: number;
|
|
524
|
+
[field: string]: unknown;
|
|
525
|
+
}[];
|
|
526
|
+
wifiAccessPoints?: {
|
|
527
|
+
macAddress: string;
|
|
528
|
+
signalStrength?: number;
|
|
529
|
+
channel?: number;
|
|
530
|
+
[field: string]: unknown;
|
|
531
|
+
}[];
|
|
532
|
+
}
|
|
533
|
+
interface GeolocateResponse {
|
|
534
|
+
location: {
|
|
535
|
+
lat: number;
|
|
536
|
+
lng: number;
|
|
537
|
+
};
|
|
538
|
+
/** Metres, at 68% confidence */
|
|
539
|
+
accuracy: number;
|
|
540
|
+
}
|
|
541
|
+
interface SnappedPoint {
|
|
542
|
+
location: LatLng;
|
|
543
|
+
/** Index of the input point this was snapped from; missing for interpolated points */
|
|
544
|
+
originalIndex?: number;
|
|
545
|
+
placeId: string;
|
|
546
|
+
}
|
|
547
|
+
interface SnapToRoadsRequest {
|
|
548
|
+
/** Up to 100 points, in order of travel */
|
|
549
|
+
path: LatLngInput[];
|
|
550
|
+
/** Add points along the road between the snapped ones */
|
|
551
|
+
interpolate?: boolean;
|
|
552
|
+
}
|
|
553
|
+
interface NearestRoadsRequest {
|
|
554
|
+
/** Up to 100 independent points */
|
|
555
|
+
points: LatLngInput[];
|
|
556
|
+
}
|
|
557
|
+
interface PostalAddress {
|
|
558
|
+
regionCode?: string;
|
|
559
|
+
languageCode?: string;
|
|
560
|
+
postalCode?: string;
|
|
561
|
+
administrativeArea?: string;
|
|
562
|
+
locality?: string;
|
|
563
|
+
sublocality?: string;
|
|
564
|
+
addressLines?: string[];
|
|
565
|
+
recipients?: string[];
|
|
566
|
+
organization?: string;
|
|
567
|
+
[field: string]: unknown;
|
|
568
|
+
}
|
|
569
|
+
interface ValidateAddressRequest {
|
|
570
|
+
address: PostalAddress;
|
|
571
|
+
/** responseId of the previous call when re-validating the same address */
|
|
572
|
+
previousResponseId?: string;
|
|
573
|
+
/** USPS CASS processing, US and PR only */
|
|
574
|
+
enableUspsCass?: boolean;
|
|
575
|
+
sessionToken?: string;
|
|
576
|
+
[field: string]: unknown;
|
|
577
|
+
}
|
|
578
|
+
interface AddressComponentValidation {
|
|
579
|
+
componentName: LocalizedText;
|
|
580
|
+
componentType: string;
|
|
581
|
+
/** CONFIRMED, UNCONFIRMED_BUT_PLAUSIBLE or UNCONFIRMED_AND_SUSPICIOUS */
|
|
582
|
+
confirmationLevel?: string;
|
|
583
|
+
inferred?: boolean;
|
|
584
|
+
spellCorrected?: boolean;
|
|
585
|
+
replaced?: boolean;
|
|
586
|
+
unexpected?: boolean;
|
|
587
|
+
}
|
|
588
|
+
interface ValidateAddressResponse {
|
|
589
|
+
result: {
|
|
590
|
+
verdict: {
|
|
591
|
+
inputGranularity?: string;
|
|
592
|
+
validationGranularity?: string;
|
|
593
|
+
geocodeGranularity?: string;
|
|
594
|
+
addressComplete?: boolean;
|
|
595
|
+
hasUnconfirmedComponents?: boolean;
|
|
596
|
+
hasInferredComponents?: boolean;
|
|
597
|
+
hasReplacedComponents?: boolean;
|
|
598
|
+
/** FIX, CONFIRM_ADD_SUBPREMISES, CONFIRM or ACCEPT */
|
|
599
|
+
possibleNextAction?: string;
|
|
600
|
+
[field: string]: unknown;
|
|
601
|
+
};
|
|
602
|
+
address: {
|
|
603
|
+
formattedAddress?: string;
|
|
604
|
+
postalAddress?: PostalAddress;
|
|
605
|
+
addressComponents?: AddressComponentValidation[];
|
|
606
|
+
missingComponentTypes?: string[];
|
|
607
|
+
unconfirmedComponentTypes?: string[];
|
|
608
|
+
unresolvedTokens?: string[];
|
|
609
|
+
};
|
|
610
|
+
geocode?: {
|
|
611
|
+
location?: LatLng;
|
|
612
|
+
placeId?: string;
|
|
613
|
+
placeTypes?: string[];
|
|
614
|
+
featureSizeMeters?: number;
|
|
615
|
+
[field: string]: unknown;
|
|
616
|
+
};
|
|
617
|
+
metadata?: {
|
|
618
|
+
business?: boolean;
|
|
619
|
+
poBox?: boolean;
|
|
620
|
+
residential?: boolean;
|
|
621
|
+
};
|
|
622
|
+
[field: string]: unknown;
|
|
623
|
+
};
|
|
624
|
+
responseId: string;
|
|
625
|
+
}
|
|
626
|
+
/** How the address was used in the end, for Google's feedback endpoint */
|
|
627
|
+
type ValidationConclusion = 'VALIDATED_VERSION_USED' | 'USER_VERSION_USED' | 'UNVALIDATED_VERSION_USED' | 'UNUSED';
|
|
628
|
+
|
|
629
|
+
export { type Route as $, type AutocompleteRequest as A, type AddressComponentValidation as B, type CallOptions as C, type Area as D, type ElevationResult as E, type FetchLike as F, type GeocodeResult as G, type Circle as H, type FormattableText as I, type LocalizedText as J, type Location as K, type LocalizedValues as L, MapsError as M, type NearestRoadsRequest as N, type OpeningHours as O, type Place as P, type Photo as Q, type Request as R, type SnappedPoint as S, type TimeZone as T, type PlacePrediction as U, type ValidateAddressRequest as V, type WaypointInput as W, type Polyline as X, type PostalAddress as Y, type QueryPrediction as Z, type Review as _, type GeolocateResponse as a, type RouteLeg as a0, type RouteLegStep as a1, type RouteMatrixDestination as a2, type RouteMatrixElement as a3, type RouteMatrixOrigin as a4, type RouteModifiers as a5, type SecondaryOpeningHours as a6, type StringRange as a7, type StructuredFormat as a8, type Suggestion as a9, type TravelMode as aa, type Viewport as ab, type FieldOptions as b, type AutocompleteResponse as c, type GetPlaceOptions as d, type Send as e, type SearchTextRequest as f, type SearchTextResponse as g, type SearchNearbyRequest as h, type SearchNearbyResponse as i, type PhotoMedia as j, type ComputeRoutesRequest as k, type ComputeRoutesResponse as l, type ComputeRouteMatrixRequest as m, type LatLngInput as n, type LatLng as o, type Waypoint as p, type ClientOptions as q, type ElevationRequest as r, type TimeZoneRequest as s, type GeolocateRequest as t, type SnapToRoadsRequest as u, type GeocodeRequest as v, type ReverseGeocodeRequest as w, type ValidateAddressResponse as x, type ValidationConclusion as y, type AddressComponent as z };
|