@types/mapbox__mapbox-gl-geocoder 5.0.0 → 5.1.1

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.
@@ -8,8 +8,8 @@ This package contains type definitions for @mapbox/mapbox-gl-geocoder (https://g
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-geocoder.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 23 Feb 2024 22:35:27 GMT
12
- * Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson), [@types/mapbox-gl](https://npmjs.com/package/@types/mapbox-gl)
11
+ * Last updated: Sat, 21 Feb 2026 05:22:18 GMT
12
+ * Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson), [mapbox-gl](https://npmjs.com/package/mapbox-gl)
13
13
 
14
14
  # Credits
15
15
  These definitions were written by [makspetrov](https://github.com/Nosfit), and [Dmytro Gokun](https://github.com/dmytro-gokun).
@@ -28,45 +28,54 @@ declare namespace MapboxGeocoder {
28
28
  interface GeocoderOptions {
29
29
  accessToken: string;
30
30
  /**
31
- * Use to set a custom API origin. (optional, default "https://api.mapbox.com"
31
+ * Use to set a custom API origin.
32
+ * @default "https://api.mapbox.com"
32
33
  */
33
34
  origin?: string | undefined;
34
35
  /**
35
- * A [mapbox-gl](https://github.com/mapbox/mapbox-gl-js) instance to use when creating [Markers](https://docs.mapbox.com/mapbox-gl-js/api/#marker). Required if `options.marker` is `true`.
36
+ * A [mapbox-gl](https://github.com/mapbox/mapbox-gl-js/api/#marker) instance to use when creating [Markers](https://docs.mapbox.com/mapbox-gl-js/api/#marker).
37
+ * Required if `options.marker` is `true`.
36
38
  */
37
39
  mapboxgl?: typeof mapboxgl | undefined;
38
40
  /**
39
- * On geocoded result what zoom level should the map animate to when a bbox isn't found in the response. If a bbox is found the map will fit to the bbox. (optional, default 16)
41
+ * On geocoded result what zoom level should the map animate to when a bbox isn't found in the response. If a bbox is found the map will fit to the bbox.
42
+ * @default 16
40
43
  */
41
44
  zoom?: number | undefined;
42
45
  /**
43
- * Override the default placeholder attribute value. (optional, default "Search")
46
+ * Override the default placeholder attribute value.
47
+ * @default "Search"
44
48
  */
45
49
  placeholder?: string | undefined;
46
50
  /**
47
51
  * If `false`, animating the map to a selected result is disabled. If `true`, animating the map will use the default animation parameters.
48
52
  * If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto)
49
- * or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition. (optional, default true)
53
+ * or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition.
54
+ * @default true
50
55
  */
51
- flyTo?: boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions | undefined;
56
+ flyTo?: boolean | mapboxgl.EasingOptions | undefined;
52
57
  /**
53
- * * @param {Object|'ip'} [options.proximity] a geographical point given as an object with `latitude` and `longitude` properties, or the string 'ip' to use a user's IP address location. Search results closer to this point will be given higher priority.
58
+ * a geographical point given as an object with `latitude` and `longitude` properties, or the string 'ip' to use a user's IP address location. Search results closer to this point will be given higher priority.
54
59
  */
55
60
  proximity?: LngLatLiteral | "ip" | undefined;
56
61
  /**
57
- * If `true`, the geocoder proximity will automatically update based on the map view. (optional, default true)
62
+ * If `true`, the geocoder proximity will automatically update based on the map view.
63
+ * @default true
58
64
  */
59
65
  trackProximity?: boolean | undefined;
60
66
  /**
61
- * If `true`, the geocoder control will collapse until hovered or in focus. (optional, default false)
67
+ * If `true`, the geocoder control will collapse until hovered or in focus.
68
+ * @default false
62
69
  */
63
70
  collapsed?: boolean | undefined;
64
71
  /**
65
- * If `true`, the geocoder control will clear it's contents and blur when user presses the escape key. (optional, default false)
72
+ * If `true`, the geocoder control will clear it's contents and blur when user presses the escape key.
73
+ * @default false
66
74
  */
67
75
  clearAndBlurOnEsc?: boolean | undefined;
68
76
  /**
69
- * If `true`, the geocoder control will clear its value when the input blurs. (optional, default false)
77
+ * If `true`, the geocoder control will clear its value when the input blurs.
78
+ * @default false
70
79
  */
71
80
  clearOnBlur?: boolean | undefined;
72
81
  /**
@@ -75,7 +84,8 @@ declare namespace MapboxGeocoder {
75
84
  */
76
85
  bbox?: Bbox | undefined;
77
86
  /**
78
- * If `true`, search input coordinates for reverse geocoding is expected to be in the form `lon, lat` instead of the default `lat, lon`. (optional, default `false`)
87
+ * If `true`, search input coordinates for reverse geocoding is expected to be in the form `lon, lat` instead of the default `lat, lon`.
88
+ * @default false
79
89
  */
80
90
  flipCoordinates?: boolean | undefined;
81
91
  /**
@@ -87,11 +97,13 @@ declare namespace MapboxGeocoder {
87
97
  */
88
98
  countries?: string | undefined;
89
99
  /**
90
- * Minimum number of characters to enter before results are shown. (optional, default 2)
100
+ * Minimum number of characters to enter before results are shown.
101
+ * @default 2
91
102
  */
92
103
  minLength?: number | undefined;
93
104
  /**
94
- * Maximum number of results to show. (optional, default 5)
105
+ * Maximum number of results to show.
106
+ * @default 5
95
107
  */
96
108
  limit?: number | undefined;
97
109
  /**
@@ -114,29 +126,33 @@ declare namespace MapboxGeocoder {
114
126
  | ((
115
127
  searchInput: string,
116
128
  features: GeoJSON.FeatureCollection<GeoJSON.Geometry>,
117
- ) => Promise<GeoJSON.FeatureCollection>)
129
+ ) => Promise<GeoJSON.FeatureCollection["features"]>)
118
130
  | undefined;
119
131
  /**
120
132
  * If `true`, enable reverse geocoding mode. In reverse geocoding, search input is expected to be coordinates in the form `lat, lon`, with suggestions being the reverse geocodes.
121
- * (optional, default false)
133
+ * @default false
122
134
  */
123
135
  reverseGeocode?: boolean | undefined;
124
136
  /**
125
- * Allow Mapbox to collect anonymous usage statistics from the plugin. (optional, default true)
137
+ * Allow Mapbox to collect anonymous usage statistics from the plugin.
138
+ * @default true
126
139
  */
127
140
  enableEventLogging?: boolean | undefined;
128
141
  /**
129
- * @param [options.enableGeolocation=false] If `true` enable user geolocation feature.
142
+ * If `true` enable user geolocation feature.
143
+ * @default false
130
144
  */
131
145
  enableGeolocation?: boolean | undefined;
132
146
  /**
133
- * @param [options.addressAccuracy="street"] The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition.
147
+ * The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition.
148
+ * @default "street"
134
149
  */
135
150
  addressAccuracy?: "address" | "street" | "place" | "country" | undefined;
136
151
  /**
137
152
  * If `true`, a [Marker](https://docs.mapbox.com/mapbox-gl-js/api/#marker) will be added to the map at the location of the user-selected result using a default set of Marker options.
138
153
  * If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map.
139
- * Requires that `options.mapboxgl` also be set. (optional, default true)
154
+ * Requires that `options.mapboxgl` also be set.
155
+ * @default true
140
156
  */
141
157
  marker?: boolean | mapboxgl.Marker | undefined;
142
158
  /**
@@ -148,12 +164,14 @@ declare namespace MapboxGeocoder {
148
164
  /**
149
165
  * A function that specifies how the selected result should be rendered in the search bar.
150
166
  * This function should accept a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and return a string.
151
- * HTML tags in the output string will not be rendered. Defaults to `(item) => item.place_name`.
167
+ * HTML tags in the output string will not be rendered.
168
+ * @default (item) => item.place_name
152
169
  */
153
170
  getItemValue?: ((feature: Result) => string) | undefined;
154
171
  /**
155
172
  * A string specifying the geocoding [endpoint](https://docs.mapbox.com/api/search/#endpoints) to query.
156
- * Options are `mapbox.places` and `mapbox.places`. The `mapbox.places-permanent` mode requires an enterprise license for permanent geocodes. (optional, default "mapbox.places")
173
+ * Options are `mapbox.places` and `mapbox.places`. The `mapbox.places-permanent` mode requires an enterprise license for permanent geocodes.
174
+ * @default "mapbox.places"
157
175
  */
158
176
  mode?: "mapbox.places" | "mapbox.places-permanent" | undefined;
159
177
  /**
@@ -163,68 +181,113 @@ declare namespace MapboxGeocoder {
163
181
  localGeocoder?: ((query: string) => Result[]) | undefined;
164
182
  /**
165
183
  * If `true`, indicates that the `localGeocoder` results should be the only ones returned to the user.
166
- * If `false`, indicates that the `localGeocoder` results should be combined with those from the Mapbox API with the `localGeocoder` results ranked higher. (optional, default false)
184
+ * If `false`, indicates that the `localGeocoder` results should be combined with those from the Mapbox API with the `localGeocoder` results ranked higher.
185
+ * @default false
167
186
  */
168
187
  localGeocoderOnly?: boolean | undefined;
169
188
  /**
170
189
  * Specify whether to return autocomplete results or not. When autocomplete is enabled,
171
190
  * results will be included that start with the requested string, rather than just responses
172
- * that match it exactly. (optional, default true)
191
+ * that match it exactly.
192
+ * @default true
173
193
  */
174
194
  autocomplete?: boolean | undefined;
175
195
  /**
176
196
  * Specify whether the Geocoding API should attempt approximate, as well as exact, matching
177
197
  * when performing searches, or whether it should opt out of this behavior and only attempt
178
- * exact matching. (optional, default true)
198
+ * exact matching.
199
+ * @default true
179
200
  */
180
201
  fuzzyMatch?: boolean | undefined;
181
202
  /**
182
203
  * Specify whether to request additional metadata about the recommended navigation
183
204
  * destination corresponding to the feature or not. Only applicable for address features.
184
- * (optional, default false)
205
+ * @default false
185
206
  */
186
207
  routing?: boolean | undefined;
187
208
  /**
188
209
  * Filter results to geographic features whose characteristics are defined differently by
189
- * audiences belonging to various regional, cultural, or political groups. (optional,
190
- * default "us")
210
+ * audiences belonging to various regional, cultural, or political groups.
211
+ * @default "us"
191
212
  */
192
213
  worldview?: string | undefined;
214
+ /**
215
+ * If `true`, the geocoder will use the browser's focus event to show suggestions.
216
+ * If `false`, it will only highlight active suggestions and Tab will not propagate to the suggestions list.
217
+ * @default false
218
+ */
219
+ useBrowserFocus?: boolean | undefined;
220
+
221
+ /**
222
+ * Set the factors that are used to sort nearby results.
223
+ * @default "distance"
224
+ */
225
+ reverseMode?: "distance" | "score" | undefined;
193
226
  }
194
227
  }
228
+ /**
229
+ * A geocoder component using the [Mapbox Geocoding API](https://docs.mapbox.com/api/search/#geocoding)
230
+ */
195
231
  declare class MapboxGeocoder implements mapboxgl.IControl {
196
232
  constructor(options?: MapboxGeocoder.GeocoderOptions);
197
233
  /**
198
234
  * The input element created by the geocoder's internal operations.
199
235
  */
200
236
  _inputEl?: HTMLInputElement;
237
+ /**
238
+ * Add the geocoder to a container. The container can be either a `mapboxgl.Map`, an `HTMLElement` or a CSS selector string.
239
+ *
240
+ * If the container is a [`mapboxgl.Map`](https://docs.mapbox.com/mapbox-gl-js/api/map/), this function will behave identically to [`Map.addControl(geocoder)`](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addcontrol).
241
+ * If the container is an instance of [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement), then the geocoder will be appended as a child of that [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).
242
+ * If the container is a [CSS selector string](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), the geocoder will be appended to the element returned from the query.
243
+ *
244
+ * This function will throw an error if the container is none of the above.
245
+ * It will also throw an error if the referenced HTML element cannot be found in the `document.body`.
246
+ *
247
+ * For example, if the HTML body contains the element `<div id='geocoder-container'></div>`, the following script will append the geocoder to `#geocoder-container`:
248
+ *
249
+ * ```javascript
250
+ * var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });
251
+ * geocoder.addTo('#geocoder-container');
252
+ * ```
253
+ * @param container A reference to the container to which to add the geocoder
254
+ */
201
255
  addTo(container: string | HTMLElement | mapboxgl.Map): this;
202
256
  onAdd(map: mapboxgl.Map): HTMLElement;
203
257
  /**
204
258
  * Set the accessToken option used for the geocoding request endpoint.
205
- * @param {String} accessToken value
259
+ * @param accessToken value
206
260
  */
207
261
  setAccessToken(accessToken: string): MapboxGeocoder;
262
+ /**
263
+ * Create icon
264
+ * @param name The name of the icon
265
+ * @param path The SVG path of the icon
266
+ */
208
267
  createIcon(name: string, path: any): SVGSVGElement;
268
+ /**
269
+ * Remove control
270
+ */
209
271
  onRemove(): this;
210
272
  /**
211
273
  * Clear and then focus the input.
212
- * [ev] the event that triggered the clear, if available
274
+ * @param ev the event that triggered the clear, if available
213
275
  */
214
276
  clear(ev?: Event): void;
215
277
  /**
216
278
  * Set & query the input
279
+ * @param searchInput location name or other search input
217
280
  */
218
281
  query(searchInput: string): this;
219
282
  /**
220
283
  * Set input
221
- * @param {string} searchInput location name or other search input
222
- * @param {boolean} [showSuggestions=false] display suggestion on setInput call
284
+ * @param searchInput location name or other search input
285
+ * @param showSuggestions display suggestion on setInput call
223
286
  */
224
287
  setInput(searchInput: string, showSuggestions?: boolean): this;
225
288
  /**
226
- * @param {Object|'ip'} proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties or the string 'ip'.
227
- * @param {Boolean} disableTrackProximity If true, sets `trackProximity` to false. True by default to prevent `trackProximity` from unintentionally overriding an explicitly set proximity value.
289
+ * @param proximity The new `options.proximity` value. This is a geographical point given as an object with `latitude` and `longitude` properties or the string 'ip'.
290
+ * @param disableTrackProximity If true, sets `trackProximity` to false. True by default to prevent `trackProximity` from unintentionally overriding an explicitly set proximity value.
228
291
  */
229
292
  setProximity(proximity: MapboxGeocoder.LngLatLiteral | "ip", disableTrackProximity?: boolean): this;
230
293
  /**
@@ -233,7 +296,7 @@ declare class MapboxGeocoder implements mapboxgl.IControl {
233
296
  getProximity(): MapboxGeocoder.LngLatLiteral;
234
297
  /**
235
298
  * Set the render function used in the results dropdown
236
- * The function to use as a render function. This function accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and returns a string.
299
+ * @param fn The function to use as a render function. This function accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) object as input and returns a string.
237
300
  */
238
301
  setRenderFunction(fn: (feature: MapboxGeocoder.Result) => string): this;
239
302
  /**
@@ -244,7 +307,7 @@ declare class MapboxGeocoder implements mapboxgl.IControl {
244
307
  * Get the language to use in UI elements and when making search requests
245
308
  *
246
309
  * Look first at the explicitly set options otherwise use the browser's language settings
247
- * language Specify the language to use for response text and query result weighting.
310
+ * @param language Specify the language to use for response text and query result weighting.
248
311
  * Options are IETF language tags comprised of a mandatory ISO 639-1 language code and optionally one or more IETF subtags for country or script.
249
312
  * More than one value can also be specified, separated by commas.
250
313
  */
@@ -259,60 +322,154 @@ declare class MapboxGeocoder implements mapboxgl.IControl {
259
322
  getZoom(): number;
260
323
  /**
261
324
  * Set the zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.
325
+ * @param zoom The zoom level that the map should animate to when a `bbox` isn't found in the response. If a `bbox` is found the map will fit to the `bbox`.
262
326
  */
263
327
  setZoom(zoom: number): this;
264
328
  /**
265
329
  * Set the flyTo options
266
- * If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters.
330
+ * @param flyTo If false, animating the map to a selected result is disabled. If true, animating the map will use the default animation parameters.
267
331
  * If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto) or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds)
268
332
  * method providing control over the animation of the transition.
269
333
  */
270
- setFlyTo(flyTo: boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions): this;
334
+ setFlyTo(flyTo: boolean | mapboxgl.EasingOptions): this;
271
335
  /**
272
336
  * Get the parameters used to fly to the selected response, if any
273
337
  */
274
- getFlyTo(): boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions;
338
+ getFlyTo(): boolean | mapboxgl.EasingOptions;
275
339
  /**
276
340
  * Get the value of the placeholder string
277
341
  */
278
342
  getPlaceholder(): string;
279
343
  /**
280
344
  * Set the value of the input element's placeholder
281
- * placeholder the text to use as the input element's placeholder
345
+ * @param placeholder the text to use as the input element's placeholder
282
346
  */
283
347
  setPlaceholder(placeholder: string): this;
348
+ /**
349
+ * Get the bounding box used by the plugin
350
+ */
284
351
  getBbox(): MapboxGeocoder.Bbox;
352
+ /**
353
+ * Set the bounding box to limit search results to
354
+ * @param bbox a bounding box given as an array in the format [minX, minY, maxX, maxY].
355
+ */
285
356
  setBbox(bbox: MapboxGeocoder.Bbox): this;
357
+ /**
358
+ * Get a list of the countries to limit search results to
359
+ */
286
360
  getCountries(): string;
361
+ /**
362
+ * Set the countries to limit search results to
363
+ * @param countries a comma separated list of countries to limit to
364
+ */
287
365
  setCountries(countries: string): this;
366
+ /**
367
+ * Get a list of the types to limit search results to
368
+ */
288
369
  getTypes(): string;
370
+ /**
371
+ * Set the types to limit search results to
372
+ * @param types a comma separated list of types to limit to
373
+ */
289
374
  setTypes(types: string): this;
375
+ /**
376
+ * Get the minimum number of characters typed to trigger results used in the plugin
377
+ */
290
378
  getMinLength(): number;
379
+ /**
380
+ * Set the minimum number of characters typed to trigger results used by the plugin
381
+ * @param minLength the minimum length in characters
382
+ */
291
383
  setMinLength(minLength: number): this;
384
+ /**
385
+ * Get the limit value for the number of results to display used by the plugin
386
+ */
292
387
  getLimit(): number;
388
+ /**
389
+ * Set the limit value for the number of results to display used by the plugin
390
+ * @param limit the number of search results to return
391
+ */
293
392
  setLimit(limit: number): this;
393
+ /**
394
+ * Get the filter function used by the plugin
395
+ */
294
396
  getFilter(): (feature: MapboxGeocoder.Result) => boolean;
397
+ /**
398
+ * Set the filter function used by the plugin.
399
+ * @param filter A function which accepts a Feature in the [extended GeoJSON](https://docs.mapbox.com/api/search/geocoding-v5/#geocoding-response-object) format to filter out results from the Geocoding API response before they are included in the suggestions list. Return `true` to keep the item, `false` otherwise.
400
+ */
295
401
  setFilter(filter: (feature: MapboxGeocoder.Result) => boolean): this;
402
+ /**
403
+ * Set the geocoding endpoint used by the plugin.
404
+ * @param origin A function which accepts an HTTPS URL to specify the endpoint to query results from.
405
+ */
296
406
  setOrigin(origin: string): this;
407
+ /**
408
+ * Get the geocoding endpoint the plugin is currently set to
409
+ */
297
410
  getOrigin(): string;
411
+ /**
412
+ * Set the autocomplete option used for geocoding requests
413
+ * @param value The boolean value to set autocomplete to
414
+ */
298
415
  setAutocomplete(value: boolean): this;
416
+ /**
417
+ * Get the current autocomplete parameter value used for requests
418
+ */
299
419
  getAutocomplete(): boolean;
420
+ /**
421
+ * Set the fuzzyMatch option used for approximate matching in geocoding requests
422
+ * @param value The boolean value to set fuzzyMatch to
423
+ */
300
424
  setFuzzyMatch(value: boolean): this;
425
+ /**
426
+ * Get the current fuzzyMatch parameter value used for requests
427
+ */
301
428
  getFuzzyMatch(): boolean;
429
+ /**
430
+ * Set the routing parameter used to ask for routable point metadata in geocoding requests
431
+ * @param value The boolean value to set routing to
432
+ */
302
433
  setRouting(value: boolean): this;
434
+ /**
435
+ * Get the current routing parameter value used for requests
436
+ */
303
437
  getRouting(): boolean;
438
+ /**
439
+ * Set the worldview parameter
440
+ * @param code The country code representing the worldview (e.g. "us" | "cn" | "jp", "in")
441
+ */
304
442
  setWorldview(code: string): this;
443
+ /**
444
+ * Get the current worldview parameter value used for requests
445
+ */
305
446
  getWorldview(): string;
306
447
  /**
307
448
  * Subscribe to events that happen within the plugin.
308
- * type name of event. Available events and the data passed into their respective event objects are:
449
+ * @param type name of event. Available events and the data passed into their respective event objects are:
309
450
  *
310
451
  * - __clear__ `Emitted when the input is cleared`
311
452
  * - __loading__ `{ query } Emitted when the geocoder is looking up a query`
312
453
  * - __results__ `{ results } Fired when the geocoder returns a response`
313
454
  * - __result__ `{ result } Fired when input is set`
314
455
  * - __error__ `{ error } Error as string`
456
+ * @param fn function that's called when the event is emitted.
457
+ */
458
+ on(type: "clear"): this;
459
+ on(type: "loading", listener: (args: { query: string }) => void): this;
460
+ on(type: "results", listener: (args: { results: MapboxGeocoder.Results }) => void): this;
461
+ on(type: "result", listener: (args: { result: MapboxGeocoder.Result }) => void): this;
462
+ on(type: "error", listener: (args: { error: unknown }) => void): this;
463
+ on(type: string, listener: (...args: any[]) => void): this;
464
+ /**
465
+ * Remove an event
466
+ * @param type Event name.
467
+ * @param fn Function that should unsubscribe to the event emitted.
315
468
  */
316
- on(type: string, fn: (...args: any[]) => void): this;
317
- off(type: string, fn: (...args: any[]) => void): this;
469
+ off(type: "clear"): this;
470
+ off(type: "loading", listener: (args: { query: string }) => void): this;
471
+ off(type: "results", listener: (args: { results: MapboxGeocoder.Results }) => void): this;
472
+ off(type: "result", listener: (args: { result: MapboxGeocoder.Result }) => void): this;
473
+ off(type: "error", listener: (args: { error: unknown }) => void): this;
474
+ off(type: string, listener: (...args: any[]) => void): this;
318
475
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/mapbox__mapbox-gl-geocoder",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "TypeScript definitions for @mapbox/mapbox-gl-geocoder",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-geocoder",
6
6
  "license": "MIT",
@@ -26,8 +26,9 @@
26
26
  "scripts": {},
27
27
  "dependencies": {
28
28
  "@types/geojson": "*",
29
- "@types/mapbox-gl": "*"
29
+ "mapbox-gl": "^3.13.0"
30
30
  },
31
- "typesPublisherContentHash": "21739ab482517596d877e1bc00c0db5b6904eac589b307784d597975fa222eba",
32
- "typeScriptVersion": "4.6"
31
+ "peerDependencies": {},
32
+ "typesPublisherContentHash": "85fb53125fb22887fe4cb8281cff0da4950d51dcec04a4186edc3de8c78fb105",
33
+ "typeScriptVersion": "5.2"
33
34
  }