@aws-amplify/geo 1.3.12-next.13 → 1.3.12-next.32
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/CHANGELOG.md +32 -0
- package/lib/Geo.js +91 -86
- package/lib/Geo.js.map +1 -1
- package/lib/Providers/AmazonLocationServiceProvider.js +160 -125
- package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib/util.js +24 -23
- package/lib/util.js.map +1 -1
- package/lib-esm/Geo.d.ts +15 -1
- package/lib-esm/Geo.js +79 -74
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +10 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +138 -100
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/types/Geo.d.ts +8 -0
- package/lib-esm/types/Provider.d.ts +3 -1
- package/lib-esm/util.d.ts +1 -0
- package/lib-esm/util.js +19 -16
- package/lib-esm/util.js.map +1 -1
- package/package.json +11 -5
- package/src/Geo.ts +45 -2
- package/src/Providers/AmazonLocationServiceProvider.ts +131 -21
- package/src/types/Geo.ts +12 -0
- package/src/types/Provider.ts +12 -0
- package/src/util.ts +23 -0
- package/build.js +0 -5
- package/dist/aws-amplify-geo.js +0 -29948
- package/dist/aws-amplify-geo.js.map +0 -1
- package/dist/aws-amplify-geo.min.js +0 -56
- package/dist/aws-amplify-geo.min.js.map +0 -1
- package/index.js +0 -7
- package/lib/Geo.d.ts +0 -96
- package/lib/Providers/AmazonLocationServiceProvider.d.ts +0 -96
- package/lib/index.d.ts +0 -2
- package/lib/types/AmazonLocationServiceProvider.d.ts +0 -24
- package/lib/types/Geo.d.ts +0 -106
- package/lib/types/Provider.d.ts +0 -14
- package/lib/types/index.d.ts +0 -3
- package/lib/util.d.ts +0 -6
- package/webpack.config.dev.js +0 -6
package/lib-esm/Geo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults } from './types';
|
|
1
|
+
import { Place, GeoConfig, Coordinates, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, MapStyle, GeofenceId, GeofenceInput, GeofenceOptions, SaveGeofencesResults, Geofence, ListGeofenceOptions, ListGeofenceResults, DeleteGeofencesResults, searchByPlaceIdOptions } from './types';
|
|
2
2
|
export declare class GeoClass {
|
|
3
3
|
static MODULE: string;
|
|
4
4
|
/**
|
|
@@ -52,6 +52,20 @@ export declare class GeoClass {
|
|
|
52
52
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
53
53
|
*/
|
|
54
54
|
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Search for search term suggestions based on input text
|
|
57
|
+
* @param {string} text - The text string that is to be search for
|
|
58
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
59
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
60
|
+
*/
|
|
61
|
+
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<import("./types").SearchForSuggestionsResults>;
|
|
62
|
+
/**
|
|
63
|
+
* Search for location by unique ID
|
|
64
|
+
* @param {string} placeId - Unique ID of the location that is to be searched for
|
|
65
|
+
* @param {searchByPlaceIdOptions} options? - Optional parameters to the search
|
|
66
|
+
* @returns {Promise<Place>} - Resolves to a place with the given placeId
|
|
67
|
+
*/
|
|
68
|
+
searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions): Promise<Place>;
|
|
55
69
|
/**
|
|
56
70
|
* Reverse geocoding search via a coordinate point on the map
|
|
57
71
|
* @param coordinates - Coordinates array for the search input
|
package/lib-esm/Geo.js
CHANGED
|
@@ -1,55 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
38
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
39
|
-
if (!m) return o;
|
|
40
|
-
var i = m.call(o), r, ar = [], e;
|
|
41
|
-
try {
|
|
42
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
43
|
-
}
|
|
44
|
-
catch (error) { e = { error: error }; }
|
|
45
|
-
finally {
|
|
46
|
-
try {
|
|
47
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
48
|
-
}
|
|
49
|
-
finally { if (e) throw e.error; }
|
|
50
|
-
}
|
|
51
|
-
return ar;
|
|
52
|
-
};
|
|
1
|
+
import { __awaiter, __generator, __read } from "tslib";
|
|
53
2
|
/*
|
|
54
3
|
* Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
55
4
|
*
|
|
@@ -62,7 +11,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
62
11
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
63
12
|
* and limitations under the License.
|
|
64
13
|
*/
|
|
65
|
-
import { Amplify, ConsoleLogger as Logger,
|
|
14
|
+
import { Amplify, ConsoleLogger as Logger, parseAWSExports, } from '@aws-amplify/core';
|
|
66
15
|
import { AmazonLocationServiceProvider } from './Providers/AmazonLocationServiceProvider';
|
|
67
16
|
import { validateCoordinates } from './util';
|
|
68
17
|
var logger = new Logger('Geo');
|
|
@@ -122,7 +71,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
122
71
|
logger.debug('configure Geo');
|
|
123
72
|
if (!config)
|
|
124
73
|
return this._config;
|
|
125
|
-
var amplifyConfig =
|
|
74
|
+
var amplifyConfig = parseAWSExports(config);
|
|
126
75
|
this._config = Object.assign({}, this._config, amplifyConfig.Geo, config);
|
|
127
76
|
this._pluggables.forEach(function (pluggable) {
|
|
128
77
|
pluggable.configure(_this._config[pluggable.getProviderName()]);
|
|
@@ -180,6 +129,62 @@ var GeoClass = /** @class */ (function () {
|
|
|
180
129
|
});
|
|
181
130
|
});
|
|
182
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Search for search term suggestions based on input text
|
|
134
|
+
* @param {string} text - The text string that is to be search for
|
|
135
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
136
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
137
|
+
*/
|
|
138
|
+
GeoClass.prototype.searchForSuggestions = function (text, options) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
+
var _a, providerName, prov, error_2;
|
|
141
|
+
return __generator(this, function (_b) {
|
|
142
|
+
switch (_b.label) {
|
|
143
|
+
case 0:
|
|
144
|
+
_a = (options || {}).providerName, providerName = _a === void 0 ? DEFAULT_PROVIDER : _a;
|
|
145
|
+
prov = this.getPluggable(providerName);
|
|
146
|
+
_b.label = 1;
|
|
147
|
+
case 1:
|
|
148
|
+
_b.trys.push([1, 3, , 4]);
|
|
149
|
+
return [4 /*yield*/, prov.searchForSuggestions(text, options)];
|
|
150
|
+
case 2: return [2 /*return*/, _b.sent()];
|
|
151
|
+
case 3:
|
|
152
|
+
error_2 = _b.sent();
|
|
153
|
+
logger.debug(error_2);
|
|
154
|
+
throw error_2;
|
|
155
|
+
case 4: return [2 /*return*/];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Search for location by unique ID
|
|
162
|
+
* @param {string} placeId - Unique ID of the location that is to be searched for
|
|
163
|
+
* @param {searchByPlaceIdOptions} options? - Optional parameters to the search
|
|
164
|
+
* @returns {Promise<Place>} - Resolves to a place with the given placeId
|
|
165
|
+
*/
|
|
166
|
+
GeoClass.prototype.searchByPlaceId = function (placeId, options) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
168
|
+
var providerName, prov, error_3;
|
|
169
|
+
return __generator(this, function (_a) {
|
|
170
|
+
switch (_a.label) {
|
|
171
|
+
case 0:
|
|
172
|
+
providerName = DEFAULT_PROVIDER;
|
|
173
|
+
prov = this.getPluggable(providerName);
|
|
174
|
+
_a.label = 1;
|
|
175
|
+
case 1:
|
|
176
|
+
_a.trys.push([1, 3, , 4]);
|
|
177
|
+
return [4 /*yield*/, prov.searchByPlaceId(placeId, options)];
|
|
178
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
179
|
+
case 3:
|
|
180
|
+
error_3 = _a.sent();
|
|
181
|
+
logger.debug(error_3);
|
|
182
|
+
throw error_3;
|
|
183
|
+
case 4: return [2 /*return*/];
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
};
|
|
183
188
|
/**
|
|
184
189
|
* Reverse geocoding search via a coordinate point on the map
|
|
185
190
|
* @param coordinates - Coordinates array for the search input
|
|
@@ -188,7 +193,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
188
193
|
*/
|
|
189
194
|
GeoClass.prototype.searchByCoordinates = function (coordinates, options) {
|
|
190
195
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
-
var _a, providerName, prov, _b, lng, lat,
|
|
196
|
+
var _a, providerName, prov, _b, lng, lat, error_4;
|
|
192
197
|
return __generator(this, function (_c) {
|
|
193
198
|
switch (_c.label) {
|
|
194
199
|
case 0:
|
|
@@ -202,9 +207,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
202
207
|
return [4 /*yield*/, prov.searchByCoordinates(coordinates, options)];
|
|
203
208
|
case 2: return [2 /*return*/, _c.sent()];
|
|
204
209
|
case 3:
|
|
205
|
-
|
|
206
|
-
logger.debug(
|
|
207
|
-
throw
|
|
210
|
+
error_4 = _c.sent();
|
|
211
|
+
logger.debug(error_4);
|
|
212
|
+
throw error_4;
|
|
208
213
|
case 4: return [2 /*return*/];
|
|
209
214
|
}
|
|
210
215
|
});
|
|
@@ -220,7 +225,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
220
225
|
*/
|
|
221
226
|
GeoClass.prototype.saveGeofences = function (geofences, options) {
|
|
222
227
|
return __awaiter(this, void 0, void 0, function () {
|
|
223
|
-
var _a, providerName, prov, geofenceInputArray,
|
|
228
|
+
var _a, providerName, prov, geofenceInputArray, error_5;
|
|
224
229
|
return __generator(this, function (_b) {
|
|
225
230
|
switch (_b.label) {
|
|
226
231
|
case 0:
|
|
@@ -238,9 +243,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
238
243
|
return [4 /*yield*/, prov.saveGeofences(geofenceInputArray, options)];
|
|
239
244
|
case 2: return [2 /*return*/, _b.sent()];
|
|
240
245
|
case 3:
|
|
241
|
-
|
|
242
|
-
logger.debug(
|
|
243
|
-
throw
|
|
246
|
+
error_5 = _b.sent();
|
|
247
|
+
logger.debug(error_5);
|
|
248
|
+
throw error_5;
|
|
244
249
|
case 4: return [2 /*return*/];
|
|
245
250
|
}
|
|
246
251
|
});
|
|
@@ -254,7 +259,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
254
259
|
*/
|
|
255
260
|
GeoClass.prototype.getGeofence = function (geofenceId, options) {
|
|
256
261
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var _a, providerName, prov,
|
|
262
|
+
var _a, providerName, prov, error_6;
|
|
258
263
|
return __generator(this, function (_b) {
|
|
259
264
|
switch (_b.label) {
|
|
260
265
|
case 0:
|
|
@@ -266,9 +271,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
266
271
|
return [4 /*yield*/, prov.getGeofence(geofenceId, options)];
|
|
267
272
|
case 2: return [2 /*return*/, _b.sent()];
|
|
268
273
|
case 3:
|
|
269
|
-
|
|
270
|
-
logger.debug(
|
|
271
|
-
throw
|
|
274
|
+
error_6 = _b.sent();
|
|
275
|
+
logger.debug(error_6);
|
|
276
|
+
throw error_6;
|
|
272
277
|
case 4: return [2 /*return*/];
|
|
273
278
|
}
|
|
274
279
|
});
|
|
@@ -283,7 +288,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
283
288
|
*/
|
|
284
289
|
GeoClass.prototype.listGeofences = function (options) {
|
|
285
290
|
return __awaiter(this, void 0, void 0, function () {
|
|
286
|
-
var _a, providerName, prov,
|
|
291
|
+
var _a, providerName, prov, error_7;
|
|
287
292
|
return __generator(this, function (_b) {
|
|
288
293
|
switch (_b.label) {
|
|
289
294
|
case 0:
|
|
@@ -295,9 +300,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
295
300
|
return [4 /*yield*/, prov.listGeofences(options)];
|
|
296
301
|
case 2: return [2 /*return*/, _b.sent()];
|
|
297
302
|
case 3:
|
|
298
|
-
|
|
299
|
-
logger.debug(
|
|
300
|
-
throw
|
|
303
|
+
error_7 = _b.sent();
|
|
304
|
+
logger.debug(error_7);
|
|
305
|
+
throw error_7;
|
|
301
306
|
case 4: return [2 /*return*/];
|
|
302
307
|
}
|
|
303
308
|
});
|
|
@@ -313,7 +318,7 @@ var GeoClass = /** @class */ (function () {
|
|
|
313
318
|
*/
|
|
314
319
|
GeoClass.prototype.deleteGeofences = function (geofenceIds, options) {
|
|
315
320
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
|
-
var _a, providerName, prov, geofenceIdsInputArray,
|
|
321
|
+
var _a, providerName, prov, geofenceIdsInputArray, error_8;
|
|
317
322
|
return __generator(this, function (_b) {
|
|
318
323
|
switch (_b.label) {
|
|
319
324
|
case 0:
|
|
@@ -331,9 +336,9 @@ var GeoClass = /** @class */ (function () {
|
|
|
331
336
|
return [4 /*yield*/, prov.deleteGeofences(geofenceIdsInputArray, options)];
|
|
332
337
|
case 2: return [2 /*return*/, _b.sent()];
|
|
333
338
|
case 3:
|
|
334
|
-
|
|
335
|
-
logger.debug(
|
|
336
|
-
throw
|
|
339
|
+
error_8 = _b.sent();
|
|
340
|
+
logger.debug(error_8);
|
|
341
|
+
throw error_8;
|
|
337
342
|
case 4: return [2 /*return*/];
|
|
338
343
|
}
|
|
339
344
|
});
|
package/lib-esm/Geo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Geo.js","sourceRoot":"","sources":["../src/Geo.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACN,OAAO,EACP,aAAa,IAAI,MAAM,EACvB,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAE1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAqB7C,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD;IAQC;QACC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,gCAAa,GAApB;QACC,OAAO,QAAQ,CAAC,MAAM,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,+BAAY,GAAnB,UAAoB,SAAsB;QACzC,IAAI,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;YACnD,IAAI,CAAC,WAAW,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EAAC;;;wBAEzC,MAAM,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;wBACpB,MAAM,OAAK,CAAC;;;;;KAEb;IAED;;;;;;;OAOG;IACU,kCAAe,GAA5B,UACC,WAA8B,EAC9B,OAAyB;;;;;;wBAEjB,KAAoC,CAAA,OAAO,IAAI,EAAE,CAAA,aAAlB,EAA/B,YAAY,mBAAG,gBAAgB,KAAA,CAAmB;wBACpD,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;wBAI7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;4BAChC,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;yBACtC;6BAAM;4BACN,qBAAqB,GAAG,WAAW,CAAC;yBACpC;;;;wBAIO,qBAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,OAAO,CAAC,EAAA;4BAAjE,sBAAO,SAA0D,EAAC;;;wBAElE,MAAM,CAAC,KAAK,CAAC,OAAK,CAAC,CAAC;wBACpB,MAAM,OAAK,CAAC;;;;;KAEb;IAvSM,eAAM,GAAG,KAAK,CAAC;IAwSvB,eAAC;CAAA,AAzSD,IAySC;SAzSY,QAAQ;AA2SrB,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,QAAQ,EAAE,CAAC;AAClC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults } from '../types';
|
|
1
|
+
import { GeoConfig, SearchByTextOptions, SearchByCoordinatesOptions, GeoProvider, Place, AmazonLocationServiceMapStyle, Coordinates, SearchForSuggestionsResults, GeofenceId, GeofenceInput, AmazonLocationServiceGeofenceOptions, AmazonLocationServiceListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, AmazonLocationServiceGeofence, AmazonLocationServiceDeleteGeofencesResults, searchByPlaceIdOptions } from '../types';
|
|
2
2
|
export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
3
3
|
static CATEGORY: string;
|
|
4
4
|
static PROVIDER_NAME: string;
|
|
@@ -44,6 +44,15 @@ export declare class AmazonLocationServiceProvider implements GeoProvider {
|
|
|
44
44
|
* @returns {Promise<Place[]>} - Promise resolves to a list of Places that match search parameters
|
|
45
45
|
*/
|
|
46
46
|
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Search for suggestions based on the input text
|
|
49
|
+
* @param {string} text - The text string that is to be searched for
|
|
50
|
+
* @param {SearchByTextOptions} options? - Optional parameters to the search
|
|
51
|
+
* @returns {Promise<SearchForSuggestionsResults>} - Resolves to an array of search suggestion strings
|
|
52
|
+
*/
|
|
53
|
+
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<SearchForSuggestionsResults>;
|
|
54
|
+
private _verifyPlaceId;
|
|
55
|
+
searchByPlaceId(placeId: string, options?: searchByPlaceIdOptions): Promise<Place | undefined>;
|
|
47
56
|
/**
|
|
48
57
|
* Reverse geocoding search via a coordinate point on the map
|
|
49
58
|
* @param coordinates - Coordinates array for the search input
|