Skip to content

Commit 7f473f3

Browse files
wgsadminmanz
andauthored
🤖 Merge PR DefinitelyTyped#74195 chore: update woosmap.map by @wgsadmin
Co-authored-by: manz <[email protected]>
1 parent 17a2dd8 commit 7f473f3

File tree

2 files changed

+204
-38
lines changed

2 files changed

+204
-38
lines changed

types/woosmap.map/index.d.ts

Lines changed: 189 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,16 @@ declare namespace woosmap.map {
11981198
* Contains methods related to retrieving autocomplete predictions, geocoding for localities and retrieving details
11991199
*/
12001200
class LocalitiesService {
1201+
/**
1202+
* To better track autocomplete sessions and get more accurate and performant results, provide a common uuid to all
1203+
* autocomplete session requests and the details request. sessionId must be reset when autocomplete input is emptied
1204+
* and when a details is successful.
1205+
*/
1206+
_sessionId: string;
1207+
/**
1208+
* Public getter to allow reading the value
1209+
*/
1210+
sessionId: string;
12011211
/**
12021212
* Contains methods related to retrieving autocomplete predictions, geocoding for localities and retrieving details
12031213
*/
@@ -1233,9 +1243,6 @@ declare namespace woosmap.map {
12331243
request: woosmap.map.localities.LocalitiesNearbyRequest,
12341244
): Promise<woosmap.map.localities.LocalitiesNearbyResponse>;
12351245

1236-
/**
1237-
* Search results based on a text-based input.
1238-
*/
12391246
search(
12401247
request: woosmap.map.localities.LocalitiesSearchRequest,
12411248
): Promise<woosmap.map.localities.LocalitiesSearchResponse>;
@@ -2957,6 +2964,11 @@ declare namespace woosmap.map.localities {
29572964
* To open suggestions to worldwide postal codes in addition to postal codes for Western Europe.
29582965
*/
29592966
data?: woosmap.map.localities.LocalitiesRequestData;
2967+
/**
2968+
* The types of suggestion to exclude. Multiple types can be passed using the pipe character (|) as a separator.
2969+
* Example: excluded_types=`suburb|quarter|neighbourhood`
2970+
*/
2971+
excluded_types?: string | string[];
29602972
/**
29612973
* If set, this parameter allows a refined search over locality names that bears the same postal code.
29622974
* possible value is `extended=postal_code`
@@ -2988,8 +3000,8 @@ declare namespace woosmap.map.localities {
29883000
/**
29893001
* The types of predictions to be returned.
29903002
* By default, suggestions return types `locality` and `postal_code`.
2991-
* can be either a single type or a list of `LocalitiesTypes`
2992-
* see [https://developers.woosmap.com/products/localities/autocomplete/#types](https://developers.woosmap.com/products/localities/autocomplete/#types)
3003+
* can be either a single type or a list of `LocalitiesTypes|LocalitiesTypesPoi|LocalitiesTypesPoiAlias`
3004+
* see [https://developers.woosmap.com/products/localities/concepts/locality-types/](https://developers.woosmap.com/products/localities/concepts/locality-types/)
29933005
*/
29943006
types?: string | string[];
29953007
}
@@ -3018,6 +3030,11 @@ declare namespace woosmap.map.localities {
30183030
* Whether to retrieve suggestions to worldwide postal codes in addition to postal codes for Western Europe.
30193031
*/
30203032
data?: woosmap.map.localities.LocalitiesRequestData;
3033+
/**
3034+
* The types of suggestion to exclude. Multiple types can be passed using the pipe character (|) as a separator.
3035+
* Example: excluded_types=`suburb|quarter|neighbourhood`
3036+
*/
3037+
excluded_types?: string | string[];
30213038
/**
30223039
* If set, it will limit the content of responses to the specified fields.
30233040
* This parameter can be any combination of geometry, address_components or shape (defaults to geometry|address_components).
@@ -3041,8 +3058,8 @@ declare namespace woosmap.map.localities {
30413058
/**
30423059
* The types of geocoding responses to be returned.
30433060
* By default, suggestions return types `locality`, `postal_code` and `address`
3044-
* can be either a single type or a list of `LocalitiesTypes`
3045-
* see [https://developers.woosmap.com/products/localities/geocode/#types](https://developers.woosmap.com/products/localities/geocode/#types)
3061+
* can be either a single type or a list of `LocalitiesTypes|LocalitiesTypesPoi|LocalitiesTypesPoiAlias`
3062+
* see [https://developers.woosmap.com/products/localities/concepts/locality-types/](https://developers.woosmap.com/products/localities/concepts/locality-types/)
30463063
*/
30473064
types?: string | string[];
30483065
}
@@ -3082,10 +3099,10 @@ declare namespace woosmap.map.localities {
30823099
interface LocalitiesNearbyRequest {
30833100
categories?: string | string[];
30843101
/**
3085-
* The language code, using ISO 3166-1 Alpha-2 country codes,
3086-
* indicating in which language the results should be returned, if possible.
3087-
* If language is not supplied, the Localities service will use english as default language.
3102+
* POI types to exclude from results
3103+
* Example: `business.food_and_drinks.fast_food|business.food_and_drinks.pub`
30883104
*/
3105+
excluded_types?: string | string[];
30893106
language?: string;
30903107
/**
30913108
* Limit of results per page. (Default is 10, max is 30)
@@ -3105,16 +3122,14 @@ declare namespace woosmap.map.localities {
31053122
*/
31063123
radius?: number;
31073124
/**
3108-
* Types of targeted items.
3109-
* The only available value for now is `point_of_interest`.
3125+
* POI types to include (pipe-separated).
3126+
* Example: `business.shop|medical.pharmacy|bank`.
3127+
* To check common POI types refer [https://developers.woosmap.com/products/localities/features/nearby/#common-poi-types](https://developers.woosmap.com/products/localities/features/nearby/#common-poi-types)
31103128
*/
3111-
types?: string | string[];
3129+
types: string | string[];
31123130
}
31133131
}
31143132
declare namespace woosmap.map.localities {
3115-
/**
3116-
* A Localities Search request to be sent to `LocalitiesService.search`
3117-
*/
31183133
interface LocalitiesSearchRequest {
31193134
/**
31203135
* The categories of points of interest to return. Multiple categories can be passed as an array of comma separated strings.
@@ -3232,9 +3247,9 @@ declare namespace woosmap.map.localities {
32323247
*/
32333248
address_components?: woosmap.map.localities.AddressComponents[];
32343249
/**
3235-
* An array containing the categories of the result, only for points of interests.
3250+
* Only available for admin_level suggestions, this contains the local english name of the administration level ("department" for France or "federal_state" for Germany).
32363251
*/
3237-
categories?: string[];
3252+
administrative_area_label?: string;
32383253
/**
32393254
* Contains the readable text description of the result.
32403255
*/
@@ -3259,7 +3274,11 @@ declare namespace woosmap.map.localities {
32593274
/**
32603275
* available localities types
32613276
*/
3262-
types: woosmap.map.localities.LocalitiesTypes[];
3277+
types: Array<
3278+
| woosmap.map.localities.LocalitiesTypes
3279+
| woosmap.map.localities.LocalitiesTypesPoi
3280+
| woosmap.map.localities.LocalitiesTypesPoiAlias
3281+
>;
32633282
}
32643283
}
32653284
declare namespace woosmap.map.localities {
@@ -3291,6 +3310,16 @@ declare namespace woosmap.map.localities {
32913310
public_id: string;
32923311
}
32933312
}
3313+
declare namespace woosmap.map.localities {
3314+
/**
3315+
* For each component (street_name, postal_code, and locality), it indicates the degree of correspondence with the original query. This value ranges from 0 to 1, with 0 indicating no match with the original query, and enables you to assess the quality of the Geocode’s result.
3316+
*/
3317+
interface LocalitiesScoresPerComponent {
3318+
locality: number;
3319+
postal_code: number;
3320+
street_name: number;
3321+
}
3322+
}
32943323
declare namespace woosmap.map.localities {
32953324
/**
32963325
* Represents a single locality prediction
@@ -3321,10 +3350,15 @@ declare namespace woosmap.map.localities {
33213350
* Contains the related information for the prediction.
33223351
*/
33233352
related?: woosmap.map.localities.LocalitiesRelated;
3353+
type?: woosmap.map.localities.LocalitiesTypes;
33243354
/**
3325-
* Contains the type of the Localities prediction.
3355+
* An array containing the types of the result.
33263356
*/
3327-
type?: woosmap.map.localities.LocalitiesTypes;
3357+
types?: Array<
3358+
| woosmap.map.localities.LocalitiesTypes
3359+
| woosmap.map.localities.LocalitiesTypesPoi
3360+
| woosmap.map.localities.LocalitiesTypesPoiAlias
3361+
>;
33283362
}
33293363
}
33303364
declare namespace woosmap.map.localities {
@@ -3336,6 +3370,14 @@ declare namespace woosmap.map.localities {
33363370
* An array containing Address Components with additional information
33373371
*/
33383372
address_components?: woosmap.map.localities.AddressComponents[];
3373+
/**
3374+
* Only available for admin_level suggestions, this contains the local english name of the administration level ("department" for France or "federal_state" for Germany).
3375+
*/
3376+
administrative_area_label?: string;
3377+
/**
3378+
* When reverse geocoding, this field represents the distance (in meters) to the requested latlng
3379+
*/
3380+
distance?: number;
33393381
/**
33403382
* Contains the readable text description of the result.
33413383
*/
@@ -3349,6 +3391,10 @@ declare namespace woosmap.map.localities {
33493391
* Contains a unique ID for geocoded locality.
33503392
*/
33513393
public_id: string;
3394+
/**
3395+
* For each component (street_name, postal_code, and locality), it indicates the degree of correspondence with the original query. This value ranges from 0 to 1, with 0 indicating no match with the original query, and enables you to assess the quality of the Geocode’s result.
3396+
*/
3397+
scores_per_components?: woosmap.map.localities.LocalitiesScoresPerComponent;
33523398
/**
33533399
* This optional field is only available for UK addresses referenced as not yey built.
33543400
*/
@@ -3360,31 +3406,142 @@ declare namespace woosmap.map.localities {
33603406
/**
33613407
* available localities types
33623408
*/
3363-
types: woosmap.map.localities.LocalitiesTypes[];
3409+
types:
3410+
| woosmap.map.localities.LocalitiesTypes[]
3411+
| woosmap.map.localities.LocalitiesTypesPoi[]
3412+
| woosmap.map.localities.LocalitiesTypesPoiAlias[];
33643413
}
33653414
}
3415+
declare namespace woosmap.map.localities {
3416+
type DeprecatedLocalitiesTypes =
3417+
| "airport"
3418+
| "amusement_park"
3419+
| "art_gallery"
3420+
| "metro_station"
3421+
| "museum"
3422+
| "shopping"
3423+
| "tourist_attraction"
3424+
| "train_station"
3425+
| "zoo"
3426+
| "point_of_interest";
3427+
}
33663428
declare namespace woosmap.map.localities {
33673429
/**
33683430
* The types of suggestion to return.
33693431
* By default, suggestions return types `locality` and `postal_code`.
33703432
* Check [full list of supported types](https://developers.woosmap.com/products/localities/autocomplete/#types)
33713433
*/
33723434
type LocalitiesTypes =
3435+
| woosmap.map.localities.DeprecatedLocalitiesTypes
3436+
| "country"
3437+
| "admin_level"
3438+
| "postal_code"
33733439
| "address"
3440+
| "route"
33743441
| "locality"
3375-
| "admin_level"
3442+
| "city"
3443+
| "town"
3444+
| "village"
3445+
| "hamlet"
3446+
| "borough"
3447+
| "suburb"
3448+
| "quarter"
3449+
| "neighbourhood";
3450+
}
3451+
declare namespace woosmap.map.localities {
3452+
/**
3453+
* Categories of points of interest (POI) supported for detailed classification in geographic data queries.
3454+
* Refer [supported POI types][https://developers.woosmap.com/products/localities/concepts/locality-types/#point-of-interest-types](https://developers.woosmap.com/products/localities/concepts/locality-types/#point-of-interest-types)
3455+
*/
3456+
type LocalitiesTypesPoi =
3457+
| "point_of_interest"
3458+
| "transit.station"
3459+
| "transit.station.airport"
3460+
| "transit.station.rail"
3461+
| "beach"
3462+
| "business"
3463+
| "business.car_repair"
3464+
| "business.car_rental"
3465+
| "business.cinema"
3466+
| "business.conference_centre"
3467+
| "business.exhibition_centre"
3468+
| "business.theatre"
3469+
| "business.nightclub"
3470+
| "business.finance"
3471+
| "business.finance.bank"
3472+
| "business.fuel"
3473+
| "business.parking"
3474+
| "business.mall"
3475+
| "business.food_and_drinks"
3476+
| "business.food_and_drinks.bar"
3477+
| "business.food_and_drinks.biergarten"
3478+
| "business.food_and_drinks.cafe"
3479+
| "business.food_and_drinks.fast_food"
3480+
| "business.food_and_drinks.pub"
3481+
| "business.food_and_drinks.restaurant"
3482+
| "business.food_and_drinks.food_court"
3483+
| "business.shop"
3484+
| "business.shop.mall"
3485+
| "business.shop.bakery"
3486+
| "business.shop.butcher"
3487+
| "business.shop.library"
3488+
| "business.shop.grocery"
3489+
| "business.shop.sports"
3490+
| "business.shop.toys"
3491+
| "business.shop.clothes"
3492+
| "business.shop.furniture"
3493+
| "business.shop.electronics"
3494+
| "business.shop.doityourself"
3495+
| "business.shop.craft"
3496+
| "education"
3497+
| "education.school"
3498+
| "education.kindergarten"
3499+
| "education.university"
3500+
| "education.college"
3501+
| "education.library"
3502+
| "hospitality"
3503+
| "hospitality.hotel"
3504+
| "hospitality.hostel"
3505+
| "hospitality.guest_house"
3506+
| "hospitality.bed_and_breakfast"
3507+
| "hospitality.motel"
3508+
| "medical"
3509+
| "medical.hospital"
3510+
| "medical.pharmacy"
3511+
| "medical.clinic"
3512+
| "tourism"
3513+
| "tourism.attraction"
3514+
| "tourism.attraction.amusement_park"
3515+
| "tourism.attraction.zoo"
3516+
| "tourism.attraction.aquarium"
3517+
| "tourism.monument"
3518+
| "tourism.monument.castle"
3519+
| "tourism.museum"
3520+
| "government"
3521+
| "park"
3522+
| "park.national"
3523+
| "place_of_worship"
3524+
| "police"
3525+
| "post_office"
3526+
| "sports"
3527+
| "sports.golf"
3528+
| "sports.winter";
3529+
}
3530+
declare namespace woosmap.map.localities {
3531+
/**
3532+
* POI aliases
3533+
*/
3534+
type LocalitiesTypesPoiAlias =
33763535
| "airport"
3377-
| "amusement_park"
3378-
| "art_gallery"
3379-
| "country"
3536+
| "train_station"
3537+
| "transit.station"
33803538
| "metro_station"
3381-
| "museum"
3382-
| "postal_code"
33833539
| "shopping"
3384-
| "tourist_attraction"
3385-
| "train_station"
3540+
| "museum"
33863541
| "zoo"
3387-
| "point_of_interest";
3542+
| "amusement_park"
3543+
| "art_gallery"
3544+
| "tourist_attraction";
33883545
}
33893546
declare namespace woosmap.map.localities {
33903547
/**
@@ -3459,9 +3616,6 @@ declare namespace woosmap.map.localities {
34593616
}
34603617
}
34613618
declare namespace woosmap.map.localities {
3462-
/**
3463-
* The types of result returned by nearby search.
3464-
*/
34653619
type LocalitiesNearbyTypes = "point_of_interest";
34663620
}
34673621
declare namespace woosmap.map.localities {
@@ -3473,9 +3627,6 @@ declare namespace woosmap.map.localities {
34733627
* An array containing Address Components with additional information
34743628
*/
34753629
address_components: woosmap.map.localities.AddressComponents[];
3476-
/**
3477-
* An array containing the categories of the result.
3478-
*/
34793630
categories: string[];
34803631
/**
34813632
* The location of the result, in latitude and longitude, eventually associated with a Viewport.
@@ -3492,7 +3643,7 @@ declare namespace woosmap.map.localities {
34923643
/**
34933644
* An array containing the types of the result.
34943645
*/
3495-
types: woosmap.map.localities.LocalitiesNearbyTypes[];
3646+
types: Array<woosmap.map.localities.LocalitiesNearbyTypes | woosmap.map.localities.LocalitiesTypesPoi>;
34963647
}
34973648
}
34983649
declare namespace woosmap.map.localities {

0 commit comments

Comments
 (0)