@nextgis/geocoder 2.4.1 → 3.0.0-alpha.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/lib/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import CancelablePromise from '@nextgis/cancelable-promise';
2
1
  import { LngLatBoundsArray, LngLatArray } from '@nextgis/utils';
3
2
  import { GeoJsonObject } from 'geojson';
4
3
  import NgwConnector, { FeatureItem, ResourceItem, NgwConnectorOptions } from '@nextgis/ngw-connector';
@@ -85,7 +84,7 @@ interface SearchItem {
85
84
  /**
86
85
  * An optional function that can be called to retrieve detailed result for this search item.
87
86
  */
88
- result?: () => CancelablePromise<ResultItem>;
87
+ result?: () => Promise<ResultItem>;
89
88
  }
90
89
 
91
90
  /**
@@ -111,7 +110,7 @@ declare abstract class BaseGeocoder<O extends Record<string, any> = Record<strin
111
110
  * @param item - The search item to get detailed result for.
112
111
  * @returns A promise that resolves to the detailed result.
113
112
  */
114
- abstract result(item: SearchItem): CancelablePromise<any>;
113
+ abstract result(item: SearchItem): Promise<any>;
115
114
  /**
116
115
  * Method for reverse geocoding.
117
116
  * Takes coordinates and returns the corresponding address or location information.
@@ -144,7 +143,7 @@ declare class Geocoder extends BaseGeocoder<GeocoderOptions> {
144
143
  constructor(options: GeocoderOptions);
145
144
  abort(): void;
146
145
  search(query: string): AsyncGenerator<SearchItem, void, unknown>;
147
- result(item: SearchItem): CancelablePromise<any>;
146
+ result(item: SearchItem): Promise<any>;
148
147
  reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
149
148
  /**
150
149
  * Returns the first reverse geocoding result for given coordinates from any provider.
@@ -205,7 +204,7 @@ declare class NgwProvider extends BaseProvider<NgwProviderOptions> {
205
204
  constructor(options: NgwProviderOptions);
206
205
  abort(): void;
207
206
  search(query: string): AsyncGenerator<NgwSearchItem, void, unknown>;
208
- result(item: NgwSearchItem): CancelablePromise<ResultItem>;
207
+ result(item: NgwSearchItem): Promise<ResultItem>;
209
208
  reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
210
209
  private _makeSignal;
211
210
  private _items;
@@ -213,11 +212,11 @@ declare class NgwProvider extends BaseProvider<NgwProviderOptions> {
213
212
 
214
213
  declare class NominatimProvider extends BaseProvider {
215
214
  searchUrl: string;
216
- private _requests;
215
+ private _abort;
217
216
  constructor(options?: BaseProviderOptions);
218
217
  abort(): void;
219
218
  search(val: string): AsyncGenerator<SearchItem, void, unknown>;
220
- result(model: SearchItem): CancelablePromise<ResultItem>;
219
+ result(model: SearchItem): Promise<ResultItem>;
221
220
  reverse(coordinates: LngLatArray): AsyncGenerator<SearchItem, void, unknown>;
222
221
  }
223
222
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextgis/geocoder",
3
- "version": "2.4.1",
3
+ "version": "3.0.0-alpha.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "lib/geocoder.esm-bundler.js",
@@ -8,16 +8,16 @@
8
8
  "jsdelivr": "lib/geocoder.global.prod.js",
9
9
  "types": "lib/index.d.ts",
10
10
  "dependencies": {
11
- "@nextgis/cancelable-promise": "^2.3.0",
12
- "@nextgis/ngw-connector": "^2.4.0",
13
- "@nextgis/ngw-kit": "^2.4.1",
14
- "@nextgis/utils": "^2.3.0",
11
+ "@nextgis/cancelable-promise": "^3.0.0-alpha.0",
12
+ "@nextgis/ngw-connector": "^3.0.0-alpha.0",
13
+ "@nextgis/ngw-kit": "^3.0.0-alpha.0",
14
+ "@nextgis/utils": "^3.0.0-alpha.0",
15
15
  "@types/events": "^3.0.0",
16
16
  "@types/geojson": "^7946.0.14",
17
17
  "events": "*"
18
18
  },
19
19
  "devDependencies": {
20
- "@nextgis/build-tools": "^2.3.0"
20
+ "@nextgis/build-tools": "^3.0.0-alpha.0"
21
21
  },
22
22
  "buildOptions": {
23
23
  "name": "Geocoder",
@@ -53,5 +53,5 @@
53
53
  "bugs": {
54
54
  "url": "https://github.com/nextgis/nextgis_frontend/issues"
55
55
  },
56
- "gitHead": "e2c63aa1f9cc0e9b051041b32fc4adc881a55d27"
56
+ "gitHead": "9bd8e48f2162492b9169298590db089a4f5310b4"
57
57
  }