apple-maps-server-sdk 1.0.5 → 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/{types.d.ts → globals.ts} +51 -0
- package/src/index.ts +10 -0
- package/src/inputs.d.ts +0 -33
- package/src/responses.d.ts +0 -16
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
|
@@ -93,3 +93,54 @@ interface ETA {
|
|
|
93
93
|
interface SearchResponsePlace extends Place {
|
|
94
94
|
poiCategory: PoiCategory;
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
export interface GeocodeInput {
|
|
98
|
+
q: string;
|
|
99
|
+
limitToCountries?: string[];
|
|
100
|
+
lang?: string;
|
|
101
|
+
searchLocation?: string;
|
|
102
|
+
searchRegion?: string;
|
|
103
|
+
userLocation?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ReverseGeocodeInput {
|
|
107
|
+
q: string;
|
|
108
|
+
lang?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ETAInput {
|
|
112
|
+
origin: string;
|
|
113
|
+
destinations: string[];
|
|
114
|
+
transportType?: TransportType;
|
|
115
|
+
departureDate?: string;
|
|
116
|
+
arrivalDate?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface SearchInput {
|
|
120
|
+
q: string;
|
|
121
|
+
excludePoiCategories?: PoiCategory[];
|
|
122
|
+
includePoiCategories?: PoiCategory[];
|
|
123
|
+
limitToCountries?: string[];
|
|
124
|
+
resultTypeFilter?: "Poi" | "Address";
|
|
125
|
+
lang?: string;
|
|
126
|
+
searchLocation?: string;
|
|
127
|
+
searchRegion?: string;
|
|
128
|
+
userLocation?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface GeocodeResponse {
|
|
132
|
+
response: Place[];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ReverseGeocodeResponse {
|
|
136
|
+
response: Place[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface ETAResponse {
|
|
140
|
+
etas: ETA[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface SearchResponse {
|
|
144
|
+
displayMapRegion: MapRegion;
|
|
145
|
+
results: SearchResponsePlace[];
|
|
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;
|
package/src/inputs.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
interface GeocodeInput {
|
|
2
|
-
q: string;
|
|
3
|
-
limitToCountries?: string[];
|
|
4
|
-
lang?: string;
|
|
5
|
-
searchLocation?: string;
|
|
6
|
-
searchRegion?: string;
|
|
7
|
-
userLocation?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface ReverseGeocodeInput {
|
|
11
|
-
q: string;
|
|
12
|
-
lang?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ETAInput {
|
|
16
|
-
origin: string;
|
|
17
|
-
destinations: string[];
|
|
18
|
-
transportType?: TransportType;
|
|
19
|
-
departureDate?: string;
|
|
20
|
-
arrivalDate?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface SearchInput {
|
|
24
|
-
q: string;
|
|
25
|
-
excludePoiCategories?: PoiCategory[];
|
|
26
|
-
includePoiCategories?: PoiCategory[];
|
|
27
|
-
limitToCountries?: string[];
|
|
28
|
-
resultTypeFilter?: "Poi" | "Address";
|
|
29
|
-
lang?: string;
|
|
30
|
-
searchLocation?: string;
|
|
31
|
-
searchRegion?: string;
|
|
32
|
-
userLocation?: string;
|
|
33
|
-
}
|
package/src/responses.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface GeocodeResponse {
|
|
2
|
-
response: Place[];
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
interface ReverseGeocodeResponse {
|
|
6
|
-
response: Place[];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface ETAResponse {
|
|
10
|
-
etas: ETA[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface SearchResponse {
|
|
14
|
-
displayMapRegion: MapRegion;
|
|
15
|
-
results: SearchResponsePlace[];
|
|
16
|
-
}
|