apple-maps-server-sdk 1.0.6 → 1.0.7
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/lib/globals.d.ts +87 -0
- package/lib/globals.js +2 -0
- package/lib/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/{globals.d.ts → globals.ts} +8 -8
- package/src/index.ts +10 -0
package/lib/globals.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
type PoiCategory = "Airport" | "AirportGate" | "AirportTerminal" | "AmusementPark" | "ATM" | "Aquarium" | "Bakery" | "Bank" | "Beach" | "Brewery" | "Cafe" | "Campground" | "CarRental" | "EVCharger" | "FireStation" | "FitnessCenter" | "FoodMarket" | "GasStation" | "Hospital" | "Hotel" | "Laundry" | "Library" | "Marina" | "MovieTheater" | "Museum" | "NationalPark" | "Nightlife" | "Park" | "Parking" | "Pharmacy" | "Playground" | "Police" | "PostOffice" | "PublicTransport" | "ReligiousSite" | "Restaurant" | "Restroom" | "School" | "Stadium" | "Store" | "Theater" | "University" | "Winery" | "Zoo";
|
|
2
|
+
type TransportType = "Automobile" | "Transit" | "Walking";
|
|
3
|
+
interface Location {
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
}
|
|
7
|
+
interface MapRegion {
|
|
8
|
+
eastLongitude: number;
|
|
9
|
+
northLatitude: number;
|
|
10
|
+
southLatitude: number;
|
|
11
|
+
westLongitude: number;
|
|
12
|
+
}
|
|
13
|
+
interface StructuredAddress {
|
|
14
|
+
administrativeArea: string;
|
|
15
|
+
administrativeAreaCode: string;
|
|
16
|
+
areasOfInterest: string[];
|
|
17
|
+
dependentLocalities: string[];
|
|
18
|
+
fullThoroughfare: string;
|
|
19
|
+
locality: string;
|
|
20
|
+
postCode: string;
|
|
21
|
+
subLocality: string;
|
|
22
|
+
subThoroughfare: string;
|
|
23
|
+
thoroughfare: string;
|
|
24
|
+
}
|
|
25
|
+
interface Place {
|
|
26
|
+
country: string;
|
|
27
|
+
countryCode: string;
|
|
28
|
+
displayMapRegion: MapRegion;
|
|
29
|
+
formattedAddressLines: string[];
|
|
30
|
+
name: string;
|
|
31
|
+
coordinate: Location;
|
|
32
|
+
structuredAddress: StructuredAddress;
|
|
33
|
+
}
|
|
34
|
+
interface ETA {
|
|
35
|
+
destination: Location;
|
|
36
|
+
distanceMeters: number;
|
|
37
|
+
expectedTravelTimeSeconds: number;
|
|
38
|
+
staticTravelTimeSeconds: number;
|
|
39
|
+
transportType: TransportType;
|
|
40
|
+
}
|
|
41
|
+
interface SearchResponsePlace extends Place {
|
|
42
|
+
poiCategory: PoiCategory;
|
|
43
|
+
}
|
|
44
|
+
export interface GeocodeInput {
|
|
45
|
+
q: string;
|
|
46
|
+
limitToCountries?: string[];
|
|
47
|
+
lang?: string;
|
|
48
|
+
searchLocation?: string;
|
|
49
|
+
searchRegion?: string;
|
|
50
|
+
userLocation?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ReverseGeocodeInput {
|
|
53
|
+
q: string;
|
|
54
|
+
lang?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ETAInput {
|
|
57
|
+
origin: string;
|
|
58
|
+
destinations: string[];
|
|
59
|
+
transportType?: TransportType;
|
|
60
|
+
departureDate?: string;
|
|
61
|
+
arrivalDate?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface SearchInput {
|
|
64
|
+
q: string;
|
|
65
|
+
excludePoiCategories?: PoiCategory[];
|
|
66
|
+
includePoiCategories?: PoiCategory[];
|
|
67
|
+
limitToCountries?: string[];
|
|
68
|
+
resultTypeFilter?: "Poi" | "Address";
|
|
69
|
+
lang?: string;
|
|
70
|
+
searchLocation?: string;
|
|
71
|
+
searchRegion?: string;
|
|
72
|
+
userLocation?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface GeocodeResponse {
|
|
75
|
+
response: Place[];
|
|
76
|
+
}
|
|
77
|
+
export interface ReverseGeocodeResponse {
|
|
78
|
+
response: Place[];
|
|
79
|
+
}
|
|
80
|
+
export interface ETAResponse {
|
|
81
|
+
etas: ETA[];
|
|
82
|
+
}
|
|
83
|
+
export interface SearchResponse {
|
|
84
|
+
displayMapRegion: MapRegion;
|
|
85
|
+
results: SearchResponsePlace[];
|
|
86
|
+
}
|
|
87
|
+
export {};
|
package/lib/globals.js
ADDED
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
+
import { GeocodeInput, GeocodeResponse, ReverseGeocodeInput, ReverseGeocodeResponse, ETAInput, ETAResponse, SearchInput, SearchResponse } from "./globals";
|
|
2
3
|
declare class AppleMaps {
|
|
3
4
|
accessToken: string;
|
|
4
5
|
authorizationToken: string;
|
package/package.json
CHANGED
|
@@ -94,7 +94,7 @@ interface SearchResponsePlace extends Place {
|
|
|
94
94
|
poiCategory: PoiCategory;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
interface GeocodeInput {
|
|
97
|
+
export interface GeocodeInput {
|
|
98
98
|
q: string;
|
|
99
99
|
limitToCountries?: string[];
|
|
100
100
|
lang?: string;
|
|
@@ -103,12 +103,12 @@ interface GeocodeInput {
|
|
|
103
103
|
userLocation?: string;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
interface ReverseGeocodeInput {
|
|
106
|
+
export interface ReverseGeocodeInput {
|
|
107
107
|
q: string;
|
|
108
108
|
lang?: string;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
interface ETAInput {
|
|
111
|
+
export interface ETAInput {
|
|
112
112
|
origin: string;
|
|
113
113
|
destinations: string[];
|
|
114
114
|
transportType?: TransportType;
|
|
@@ -116,7 +116,7 @@ interface ETAInput {
|
|
|
116
116
|
arrivalDate?: string;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
interface SearchInput {
|
|
119
|
+
export interface SearchInput {
|
|
120
120
|
q: string;
|
|
121
121
|
excludePoiCategories?: PoiCategory[];
|
|
122
122
|
includePoiCategories?: PoiCategory[];
|
|
@@ -128,19 +128,19 @@ interface SearchInput {
|
|
|
128
128
|
userLocation?: string;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
interface GeocodeResponse {
|
|
131
|
+
export interface GeocodeResponse {
|
|
132
132
|
response: Place[];
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
interface ReverseGeocodeResponse {
|
|
135
|
+
export interface ReverseGeocodeResponse {
|
|
136
136
|
response: Place[];
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
interface ETAResponse {
|
|
139
|
+
export interface ETAResponse {
|
|
140
140
|
etas: ETA[];
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
interface SearchResponse {
|
|
143
|
+
export interface SearchResponse {
|
|
144
144
|
displayMapRegion: MapRegion;
|
|
145
145
|
results: SearchResponsePlace[];
|
|
146
146
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import axios, { AxiosError, AxiosInstance } from "axios";
|
|
2
|
+
import {
|
|
3
|
+
GeocodeInput,
|
|
4
|
+
GeocodeResponse,
|
|
5
|
+
ReverseGeocodeInput,
|
|
6
|
+
ReverseGeocodeResponse,
|
|
7
|
+
ETAInput,
|
|
8
|
+
ETAResponse,
|
|
9
|
+
SearchInput,
|
|
10
|
+
SearchResponse,
|
|
11
|
+
} from "./globals";
|
|
2
12
|
|
|
3
13
|
class AppleMaps {
|
|
4
14
|
accessToken: string;
|