Skip to content

Commit ea93fee

Browse files
wgsadmingaelsimon
andauthored
🤖 Merge PR DefinitelyTyped#72173 chore: update woosmap.map by @wgsadmin
Co-authored-by: gaelsimon <[email protected]>
1 parent dfc45cb commit ea93fee

File tree

2 files changed

+144
-3
lines changed

2 files changed

+144
-3
lines changed

types/woosmap.map/index.d.ts

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ declare namespace woosmap.map {
950950
union(other: woosmap.map.LatLngBounds): void;
951951

952952
/**
953-
* Returns the north-east corner of this bounds.
953+
* Returns the north-east corner of these bounds.
954954
*/
955955
getNorthEast(): woosmap.map.LatLng;
956956

@@ -1227,6 +1227,13 @@ declare namespace woosmap.map {
12271227
nearby(
12281228
request: woosmap.map.localities.LocalitiesNearbyRequest,
12291229
): Promise<woosmap.map.localities.LocalitiesNearbyResponse>;
1230+
1231+
/**
1232+
* Search results based on a text-based input.
1233+
*/
1234+
search(
1235+
request: woosmap.map.localities.LocalitiesSearchRequest,
1236+
): Promise<woosmap.map.localities.LocalitiesSearchResponse>;
12301237
}
12311238
}
12321239
declare namespace woosmap.map {
@@ -1380,7 +1387,7 @@ declare namespace woosmap.map {
13801387
}
13811388
declare namespace woosmap.map {
13821389
class DatasetsOverlay {
1383-
constructor(datasetId: string);
1390+
constructor(datasetId: string, options?: woosmap.map.DatasetsOverlayOptions);
13841391

13851392
/**
13861393
* Adds or remove the overlay from the map.
@@ -3095,6 +3102,42 @@ declare namespace woosmap.map.localities {
30953102
types?: string | string[];
30963103
}
30973104
}
3105+
declare namespace woosmap.map.localities {
3106+
/**
3107+
* A Localities Search request to be sent to `LocalitiesService.search`
3108+
*/
3109+
interface LocalitiesSearchRequest {
3110+
/**
3111+
* Used to filter over countries. Countries must be passed as an
3112+
* ISO 3166-1 Alpha-2 or Alpha-3 compatible country code.
3113+
*/
3114+
components: woosmap.map.localities.LocalitiesComponentRestrictions;
3115+
/**
3116+
* The user entered input string.
3117+
*/
3118+
input: string;
3119+
/**
3120+
* The language code, using ISO 3166-1 Alpha-2 country codes,
3121+
* indicating in which language the results should be returned, if possible.
3122+
* If language is not supplied, the Localities service will use english as default language.
3123+
*/
3124+
language?: string;
3125+
/**
3126+
* The center of the search circle.
3127+
*/
3128+
location: woosmap.map.LatLng | woosmap.map.LatLngLiteral;
3129+
/**
3130+
* Define the distance in meters within which the API will return results.
3131+
* Default radius if this parameter is not set is 100 000.
3132+
*/
3133+
radius?: number;
3134+
/**
3135+
* Types of targeted items.
3136+
* Available values are `point_of_interest`, `address`, `locality`, `postal_code`, `admin_level`, `country`.
3137+
*/
3138+
types: string | string[];
3139+
}
3140+
}
30983141
declare namespace woosmap.map.localities {
30993142
/**
31003143
* A Localities Autocomplete response returned by the call to
@@ -3142,6 +3185,19 @@ declare namespace woosmap.map.localities {
31423185
results: woosmap.map.localities.LocalitiesNearbyResult[];
31433186
}
31443187
}
3188+
declare namespace woosmap.map.localities {
3189+
/**
3190+
* A Localities Search response returned by the call to
3191+
* `LocalitiesService.search` containing a
3192+
* list of `LocalitiesSearchResult`.
3193+
*/
3194+
interface LocalitiesSearchResponse {
3195+
/**
3196+
* The array of search results.
3197+
*/
3198+
results: woosmap.map.localities.LocalitiesSearchResult[];
3199+
}
3200+
}
31453201
declare namespace woosmap.map.localities {
31463202
/**
31473203
* Defines information about a Locality.
@@ -3151,6 +3207,10 @@ declare namespace woosmap.map.localities {
31513207
* An array containing Address Components with additional information
31523208
*/
31533209
address_components?: woosmap.map.localities.AddressComponents[];
3210+
/**
3211+
* An array containing the categories of the result, only for points of interests.
3212+
*/
3213+
categories?: string[];
31543214
/**
31553215
* Contains the readable text description of the result.
31563216
*/
@@ -3299,7 +3359,8 @@ declare namespace woosmap.map.localities {
32993359
| "shopping"
33003360
| "tourist_attraction"
33013361
| "train_station"
3302-
| "zoo";
3362+
| "zoo"
3363+
| "point_of_interest";
33033364
}
33043365
declare namespace woosmap.map.localities {
33053366
/**
@@ -3434,6 +3495,46 @@ declare namespace woosmap.map.localities {
34343495
previous_page?: number;
34353496
}
34363497
}
3498+
declare namespace woosmap.map.localities {
3499+
/**
3500+
* The types of result returned by search.
3501+
*/
3502+
type LocalitiesSearchTypes =
3503+
| "point_of_interest"
3504+
| "address"
3505+
| "locality"
3506+
| "postal_code"
3507+
| "route"
3508+
| "admin_level"
3509+
| "country";
3510+
}
3511+
declare namespace woosmap.map.localities {
3512+
/**
3513+
* Defines information about a Search element.
3514+
*/
3515+
interface LocalitiesSearchResult {
3516+
/**
3517+
* An array containing the categories of the result if it's a point of interest.
3518+
*/
3519+
categories?: string[];
3520+
/**
3521+
* The description for the result.
3522+
*/
3523+
description?: string;
3524+
/**
3525+
* Contains a unique ID for each result. Please use this ID to give feedbacks on results.
3526+
*/
3527+
public_id: string;
3528+
/**
3529+
* The title for the result.
3530+
*/
3531+
title: string;
3532+
/**
3533+
* An array containing the types of the result.
3534+
*/
3535+
types: woosmap.map.localities.LocalitiesSearchTypes[];
3536+
}
3537+
}
34373538
declare namespace woosmap.map {
34383539
/**
34393540
* Summary feature response, part of DatasetsSearchResponse.
@@ -3737,6 +3838,26 @@ declare namespace woosmap.map.transit {
37373838
status: "OK" | "NOT_FOUND";
37383839
}
37393840
}
3841+
declare namespace woosmap.map {
3842+
interface DatasetsOverlayOptions {
3843+
/**
3844+
* Sets the line stroke color.
3845+
*/
3846+
defaultLineColor?: string;
3847+
/**
3848+
* Sets the point color.
3849+
*/
3850+
defaultPointColor?: string;
3851+
/**
3852+
* Sets the fill stroke color.
3853+
*/
3854+
defaultPolygonFillColor?: string;
3855+
/**
3856+
* Sets the polygon stroke color.
3857+
*/
3858+
defaultPolygonStrokeColor?: string;
3859+
}
3860+
}
37403861
declare namespace woosmap.map {
37413862
enum DirectionStatus {
37423863
OK = "OK",
@@ -4172,6 +4293,11 @@ declare namespace woosmap.map {
41724293
* Triggers event to notify user has deviated from path during navigation
41734294
*/
41744295
notifyUserDeviated(currentLocation: GeoJSONFeature): void;
4296+
4297+
/**
4298+
* Triggers event to notify user's proximity to destination
4299+
*/
4300+
notifyProximityToDest(): void;
41754301
}
41764302
}
41774303
declare namespace woosmap.map {

types/woosmap.map/woosmap.map-tests.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,21 @@ promiseLocalitiesGeocode.then((result) => {
561561
result;
562562
});
563563

564+
const localitiesSearchRequest = expectType({
565+
input: "example input",
566+
types: ["locality", "postal_code"],
567+
components: { country: ["FR"] },
568+
location: { lat: 43.2, lng: 2.3 },
569+
radius: 50000,
570+
language: "en",
571+
}) as woosmap.map.localities.LocalitiesSearchRequest;
572+
573+
const promiseLocalitiesSearch = localitiesService.search(localitiesSearchRequest);
574+
promiseLocalitiesSearch.then((result) => {
575+
// $ExpectType LocalitiesSearchResponse
576+
result;
577+
});
578+
564579
/**
565580
* Stores Service
566581
*/

0 commit comments

Comments
 (0)