Skip to content

Commit 9015868

Browse files
wgsadminmanz
andauthored
🤖 Merge PR DefinitelyTyped#72491 chore: update woosmap.map by @wgsadmin
Co-authored-by: manz <[email protected]>
1 parent f050450 commit 9015868

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

types/woosmap.map/index.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ declare namespace woosmap.map.localities {
30713071
* A Localities Nearby request to be sent to `LocalitiesService.nearby`
30723072
*/
30733073
interface LocalitiesNearbyRequest {
3074-
categories?: string;
3074+
categories?: string | string[];
30753075
/**
30763076
* The language code, using ISO 3166-1 Alpha-2 country codes,
30773077
* indicating in which language the results should be returned, if possible.
@@ -3107,11 +3107,26 @@ declare namespace woosmap.map.localities {
31073107
* A Localities Search request to be sent to `LocalitiesService.search`
31083108
*/
31093109
interface LocalitiesSearchRequest {
3110+
/**
3111+
* The categories of points of interest to return. Multiple categories can be passed as an array of comma separated strings.
3112+
* Example: `categories=['tourism', 'education']`
3113+
*/
3114+
categories?: string | string[];
31103115
/**
31113116
* Used to filter over countries. Countries must be passed as an
31123117
* ISO 3166-1 Alpha-2 or Alpha-3 compatible country code.
31133118
*/
31143119
components: woosmap.map.localities.LocalitiesComponentRestrictions;
3120+
/**
3121+
* The categories of points of interest to exclude from results. Multiple categories can be passed as an array of comma separated strings.
3122+
* Example: `excluded_categories=['hospitality.hostel','hospitality.guest_house']`
3123+
*/
3124+
excluded_categories?: string | string[];
3125+
/**
3126+
* The types of suggestions to exclude.
3127+
* see available types to exclude [https://developers.woosmap.com/products/localities/search/#types](https://developers.woosmap.com/products/localities/search/#types)
3128+
*/
3129+
excluded_types?: string | string[];
31153130
/**
31163131
* The user entered input string.
31173132
*/

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,16 @@ promiseLocalitiesGeocode.then((result) => {
560560
// $ExpectType LocalitiesGeocodeResponse
561561
result;
562562
});
563-
564563
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",
564+
input: "royal al",
565+
types: ["point_of_interest", "address"],
566+
language: "EN",
567+
components: { country: ["GB", "FR"] },
568+
radius: 5000000,
569+
location: { lat: 51.5007, lng: -0.1246 },
570+
categories: ["tourism", "hospitality"],
571+
excluded_categories: "hospitality.hostel",
572+
excluded_types: ["admin_level", "village"],
571573
}) as woosmap.map.localities.LocalitiesSearchRequest;
572574

573575
const promiseLocalitiesSearch = localitiesService.search(localitiesSearchRequest);

0 commit comments

Comments
 (0)