@types/mapbox__mapbox-gl-geocoder 4.7.0 → 4.7.3

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.
File without changes
@@ -8,7 +8,7 @@ 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: Wed, 03 Feb 2021 10:22:58 GMT
11
+ * Last updated: Mon, 15 Aug 2022 21:02:37 GMT
12
12
  * Dependencies: [@types/mapbox-gl](https://npmjs.com/package/@types/mapbox-gl), [@types/geojson](https://npmjs.com/package/@types/geojson)
13
13
  * Global values: `MapboxGeocoder`
14
14
 
@@ -4,8 +4,10 @@
4
4
  // Dmytro Gokun <https://github.com/dmytro-gokun>
5
5
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
6
 
7
- /// <reference types="mapbox-gl" />
8
7
  /// <reference types="geojson" />
8
+
9
+ import mapboxgl = require('mapbox-gl');
10
+
9
11
  export as namespace MapboxGeocoder;
10
12
  export = MapboxGeocoder;
11
13
 
@@ -34,128 +36,128 @@ declare namespace MapboxGeocoder {
34
36
  /**
35
37
  * Use to set a custom API origin. (optional, default "https://api.mapbox.com"
36
38
  */
37
- origin?: string;
39
+ origin?: string | undefined;
38
40
  /**
39
41
  * 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`.
40
42
  */
41
- mapboxgl?: mapboxgl.Map;
43
+ mapboxgl?: typeof mapboxgl | undefined;
42
44
  /**
43
45
  * 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)
44
46
  */
45
- zoom?: number;
47
+ zoom?: number | undefined;
46
48
  /**
47
49
  * Override the default placeholder attribute value. (optional, default "Search")
48
50
  */
49
- placeholder?: string;
51
+ placeholder?: string | undefined;
50
52
  /**
51
53
  * If `false`, animating the map to a selected result is disabled. If `true`, animating the map will use the default animation parameters.
52
54
  * If an object, it will be passed as `options` to the map [`flyTo`](https://docs.mapbox.com/mapbox-gl-js/api/#map#flyto)
53
55
  * or [`fitBounds`](https://docs.mapbox.com/mapbox-gl-js/api/#map#fitbounds) method providing control over the animation of the transition. (optional, default true)
54
56
  */
55
- flyTo?: boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions;
57
+ flyTo?: boolean | mapboxgl.FlyToOptions | mapboxgl.FitBoundsOptions | undefined;
56
58
  /**
57
59
  * a proximity argument: this is a geographical point given as an object with latitude and longitude properties. Search results closer to this point will be given higher priority.
58
60
  */
59
- proximity?: LngLatLiteral;
61
+ proximity?: LngLatLiteral | undefined;
60
62
  /**
61
63
  * If `true`, the geocoder proximity will automatically update based on the map view. (optional, default true)
62
64
  */
63
- trackProximity?: boolean;
65
+ trackProximity?: boolean | undefined;
64
66
  /**
65
67
  * If `true`, the geocoder control will collapse until hovered or in focus. (optional, default false)
66
68
  */
67
- collapsed?: boolean;
69
+ collapsed?: boolean | undefined;
68
70
  /**
69
71
  * If `true`, the geocoder control will clear it's contents and blur when user presses the escape key. (optional, default false)
70
72
  */
71
- clearAndBlurOnEsc?: boolean;
73
+ clearAndBlurOnEsc?: boolean | undefined;
72
74
  /**
73
75
  * If `true`, the geocoder control will clear its value when the input blurs. (optional, default false)
74
76
  */
75
- clearOnBlur?: boolean;
77
+ clearOnBlur?: boolean | undefined;
76
78
  /**
77
79
  * a bounding box argument: this is a bounding box given as an array in the format [minX, minY, maxX, maxY].
78
80
  * Search results will be limited to the bounding box.
79
81
  */
80
- bbox?: Bbox;
82
+ bbox?: Bbox | undefined;
81
83
  /**
82
84
  * a comma seperated list of types that filter results to match those specified. See https://www.mapbox.com/developers/api/geocoding/#filter-type for available types.
83
85
  */
84
- types?: string;
86
+ types?: string | undefined;
85
87
  /**
86
88
  * a comma separated list of country codes to limit results to specified country or countries.
87
89
  */
88
- countries?: string;
90
+ countries?: string | undefined;
89
91
  /**
90
92
  * Minimum number of characters to enter before results are shown. (optional, default 2)
91
93
  */
92
- minLength?: number;
94
+ minLength?: number | undefined;
93
95
  /**
94
96
  * Maximum number of results to show. (optional, default 5)
95
97
  */
96
- limit?: number;
98
+ limit?: number | undefined;
97
99
  /**
98
100
  * Specify the language to use for response text and query result weighting.
99
101
  * 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.
100
102
  * More than one value can also be specified, separated by commas. Defaults to the browser's language settings.
101
103
  */
102
- language?: string;
104
+ language?: string | undefined;
103
105
  /**
104
106
  * A function which accepts a Feature in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md)
105
107
  * format to filter out results from the Geocoding API response before they are included in the suggestions list.
106
108
  * Return `true` to keep the item, `false` otherwise.
107
109
  */
108
- filter?: (feature: Result) => boolean;
110
+ filter?: ((feature: Result) => boolean) | undefined;
109
111
  /**
110
112
  * A function accepting the query string and current features list which performs geocoding to supplement results from the Mapbox Geocoding API.
111
113
  * Expected to return a Promise which resolves to an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format.
112
114
  */
113
- externalGeocoder?: (
115
+ externalGeocoder?: ((
114
116
  searchInput: string,
115
117
  features: GeoJSON.FeatureCollection<GeoJSON.Geometry>,
116
- ) => Promise<GeoJSON.FeatureCollection>;
118
+ ) => Promise<GeoJSON.FeatureCollection>) | undefined;
117
119
  /**
118
120
  * 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.
119
121
  * (optional, default false)
120
122
  */
121
- reverseGeocode?: boolean;
123
+ reverseGeocode?: boolean | undefined;
122
124
  /**
123
125
  * Allow Mapbox to collect anonymous usage statistics from the plugin. (optional, default true)
124
126
  */
125
- enableEventLogging?: boolean;
127
+ enableEventLogging?: boolean | undefined;
126
128
  /**
127
129
  * 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.
128
130
  * If the value is an object, the marker will be constructed using these options. If `false`, no marker will be added to the map.
129
131
  * Requires that `options.mapboxgl` also be set. (optional, default true)
130
132
  */
131
- marker?: boolean | mapboxgl.Marker;
133
+ marker?: boolean | mapboxgl.Marker | undefined;
132
134
  /**
133
135
  * A function that specifies how the results should be rendered in the dropdown menu.
134
136
  * This function should accepts a single [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md)
135
137
  * object as input and return a string. Any HTML in the returned string will be rendered.
136
138
  */
137
- render?: (feature: Result) => string;
139
+ render?: ((feature: Result) => string) | undefined;
138
140
  /**
139
141
  * A function that specifies how the selected result should be rendered in the search bar.
140
142
  * 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.
141
143
  * HTML tags in the output string will not be rendered. Defaults to `(item) => item.place_name`.
142
144
  */
143
- getItemValue?: (feature: Result) => string;
145
+ getItemValue?: ((feature: Result) => string) | undefined;
144
146
  /**
145
147
  * A string specifying the geocoding [endpoint](https://docs.mapbox.com/api/search/#endpoints) to query.
146
148
  * Options are `mapbox.places` and `mapbox.places`. The `mapbox.places-permanent` mode requires an enterprise license for permanent geocodes. (optional, default "mapbox.places")
147
149
  */
148
- mode?: 'mapbox.places' | 'mapbox.places-permanent';
150
+ mode?: 'mapbox.places' | 'mapbox.places-permanent' | undefined;
149
151
  /**
150
152
  * A function accepting the query string which performs local geocoding to supplement results from the Mapbox Geocoding API.
151
153
  * Expected to return an Array of GeoJSON Features in the [Carmen GeoJSON](https://github.com/mapbox/carmen/blob/master/carmen-geojson.md) format.
152
154
  */
153
- localGeocoder?: (query: string) => Result[];
155
+ localGeocoder?: ((query: string) => Result[]) | undefined;
154
156
  /**
155
157
  * If `true`, indicates that the `localGeocoder` results should be the only ones returned to the user.
156
158
  * 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)
157
159
  */
158
- localGeocoderOnly?: boolean;
160
+ localGeocoderOnly?: boolean | undefined;
159
161
  }
160
162
  }
161
163
  declare class MapboxGeocoder implements mapboxgl.IControl {
@@ -167,9 +169,8 @@ declare class MapboxGeocoder implements mapboxgl.IControl {
167
169
  /**
168
170
  * Clear and then focus the input.
169
171
  * [ev] the event that triggered the clear, if available
170
- *
171
172
  */
172
- clear(ev: Event): void;
173
+ clear(ev?: Event): void;
173
174
  /**
174
175
  * Set & query the input
175
176
  */
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/mapbox__mapbox-gl-geocoder",
3
- "version": "4.7.0",
3
+ "version": "4.7.3",
4
4
  "description": "TypeScript definitions for @mapbox/mapbox-gl-geocoder",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-geocoder",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -27,6 +28,6 @@
27
28
  "@types/geojson": "*",
28
29
  "@types/mapbox-gl": "*"
29
30
  },
30
- "typesPublisherContentHash": "47c579a0226d9dc0589847ab9620ad18aac494bf8bf0f2bdfa72d009477d01eb",
31
- "typeScriptVersion": "3.4"
31
+ "typesPublisherContentHash": "ac60019e648e6f3f2857ae2961b129400b9f4775a9bf2a22627453599256c68e",
32
+ "typeScriptVersion": "4.0"
32
33
  }