From 7416df64486cec4eb88caeae7647d9461c6268db Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:56:59 +0200 Subject: [PATCH 1/8] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a14a99c..b2bb859 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mapkit-typescript", - "version": "5.18.2", + "version": "5.44.0", "description": "Typescript type definitions for MapKit JS", "repository": "wsmd/mapkit-typescript", "types": "./mapkit/index.d.ts", From 3581101e2a4f421c2e2d4c19b9e6fef56a60a053 Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:57:56 +0200 Subject: [PATCH 2/8] Update Map --- mapkit/mapkit.Map.d.ts | 141 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/mapkit/mapkit.Map.d.ts b/mapkit/mapkit.Map.d.ts index 255839c..f83fef4 100644 --- a/mapkit/mapkit.Map.d.ts +++ b/mapkit/mapkit.Map.d.ts @@ -106,6 +106,33 @@ declare namespace mapkit { * Changes the map's visible map rectangle to the specified map rectangle. */ setVisibleMapRectAnimated(mapRect: mapkit.MapRect, animate?: boolean): this; + /** + * Sets a constraint for the center of the map. + */ + cameraBoundary: CameraBoundaryDescription; + /** + * Changes the map's camera boundary with an animated transition. + */ + setCameraBoundaryAnimated( + coordinateRegion: CoordinateRegion | MapRect, + animate?: boolean, + ): this; + /** + * Sets the altitude of the camera above the center of the map. + */ + cameraDistance: number; + /** + * Changes the map's camera distance with an animated transition. + */ + setCameraDistanceAnimated(distance: number, animate?: boolean): this; + /** + * Sets the minimum and maximum distance of the camera from the map center. + */ + cameraZoomRange: CameraZoomRange; + /** + * Changes the map's camera zoom range with an animated transition. + */ + setCameraZoomRangeAnimated(cameraZoomRange: CameraZoomRange, animate?: boolean): this; // Configuring the Map's Appearance @@ -449,6 +476,8 @@ declare namespace mapkit { * A Boolean value that determines whether the user location control is visible. */ showsUserLocationControl?: boolean; + + pointOfInterestFilter?: mapkit.PointOfInterestFilter; } /** @@ -507,4 +536,116 @@ declare namespace mapkit { */ minimumSpan?: mapkit.CoordinateSpan; } + + /** + * An object literal containing at least one property defining an area on the map. + */ + interface CameraBoundaryDescription { + /** + * A rectangular area on a two-dimensional map projection. + */ + mapRect: mapkit.MapRect; + /** + * A rectangular area on a map, defined by coordinates of the rectangle's + * northeast and southwest corners. + */ + region: mapkit.CoordinateRegion; + } + + /** + * A minimum and maximum camera distance as meters from the center of the map. + */ + class CameraZoomRange { + /** + * Describes the minimum and maximum camera distance in meters. + * + * @parent parent A DOM element or the ID of a DOM element to use as this + * map's container. + * @param options An object that contains options for initializing a map's + * features. + */ + constructor( + minCameraDistance: CameraZoomRangeConstructorOptions | number, + maxCameraDistance?: number, + ); + /** + * The minimum allowed distance of the camera from the center of the map in + * meters. + */ + minCameraDistance: number; + /** + * The maximum allowed distance of the camera from the center of the map in + * meters. + */ + maxCameraDistance: number; + } + + /** + * Initialization options for the camera zoom range. + */ + interface CameraZoomRangeConstructorOptions { + /** + * The minimum allowed distance of the camera from the center of the map in + * meters. + */ + minCameraDistance: number; + /** + * The maximum allowed distance of the camera from the center of the map in + * meters. + */ + maxCameraDistance: number; + } + + interface PointOfInterestFilter { + excludesCategory(category: PointOfInterestCategory): boolean; + excluding(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; + includesCategory(category: PointOfInterestCategory): boolean; + including(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; + + filterExcludingAllCategories: PointOfInterestFilter; + filterIncludingAllCategories: PointOfInterestFilter; + } + + interface PointOfInterestCategory { + Airport: string; + AmusementPark: string; + Aquarium: string; + ATM: string; + Bakery: string; + Bank: string; + Beach: string; + Brewery: string; + Cafe: string; + Campground: string; + CarRental: string; + EVCharger: string; + FireStation: string; + FitnessCenter: string; + FoodMarket: string; + GasStation: string; + Hospital: string; + Hotel: string; + Laundry: string; + Library: string; + Marina: string; + MovieTheater: string; + Museum: string; + NationalPark: string; + Nightlife: string; + Park: string; + Parking: string; + Pharmacy: string; + Police: string; + PostOffice: string; + PublicTransport: string; + Restaurant: string; + Restroom: string; + School: string; + Stadium: string; + Store: string; + Theater: string; + University: string; + Winery: string; + Zoo: string; + } } From d4394f0a1d81ce3b227e6e67677a74ac82e3d802 Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:56:42 +0200 Subject: [PATCH 3/8] Update Search --- mapkit/mapkit.Search.d.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mapkit/mapkit.Search.d.ts b/mapkit/mapkit.Search.d.ts index 1c9fd75..22a9a3b 100644 --- a/mapkit/mapkit.Search.d.ts +++ b/mapkit/mapkit.Search.d.ts @@ -39,7 +39,7 @@ declare namespace mapkit { autocomplete( query: string, callback: SearchDelegate | AutocompleteSearchCallback, - options?: SearchOptions, + options?: SearchAutocompleteOptions, ): void; /** * Cancels a search request using its request ID. @@ -71,6 +71,11 @@ declare namespace mapkit { * A map region that provides a hint for the geographic area to search. */ region?: mapkit.CoordinateRegion; + + includeAddresses?: boolean; + includePointsOfInterest?: boolean; + includeQueries?: boolean; + pointOfInterestFilter?: PointOfInterestFilter; } type SearchCallback = ( @@ -137,6 +142,10 @@ declare namespace mapkit { * A map region that provides a hint for the geographic area to search. */ region: mapkit.CoordinateRegion; + + includeAddresses: boolean; + includePointsOfInterest: boolean; + pointOfInterestFilter: boolean; } /** @@ -185,4 +194,14 @@ declare namespace mapkit { */ coordinate: mapkit.Coordinate; } + + interface SearchAutocompleteOptions { + language: string; + coordinate: mapkit.Coordinate; + region: mapkit.CoordinateRegion; + includeAddresses: boolean; + includePointsOfInterest: boolean; + includeQueries: boolean; + pointOfInterestFilter: mapkit.PointOfInterestFilter; + } } From 939c7f549a950a9dfbb21cf749b81d95de0274c1 Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Mon, 8 Jun 2020 18:26:15 +0200 Subject: [PATCH 4/8] Update Directions --- mapkit/mapkit.Directions.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mapkit/mapkit.Directions.d.ts b/mapkit/mapkit.Directions.d.ts index 590c62a..43fad74 100644 --- a/mapkit/mapkit.Directions.d.ts +++ b/mapkit/mapkit.Directions.d.ts @@ -80,6 +80,9 @@ declare namespace mapkit { * routes when they are available. */ requestsAlternateRoutes?: boolean; + + arrivalDate?: Date; + departureDate?: Date; } /** From 24035352a030666cdb8cde7f9ec27f85477b18f5 Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Mon, 8 Jun 2020 18:26:58 +0200 Subject: [PATCH 5/8] Update Geocoder --- mapkit/mapkit.Geocoder.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mapkit/mapkit.Geocoder.d.ts b/mapkit/mapkit.Geocoder.d.ts index 1af0a30..8eee065 100644 --- a/mapkit/mapkit.Geocoder.d.ts +++ b/mapkit/mapkit.Geocoder.d.ts @@ -123,5 +123,18 @@ declare namespace mapkit { * The country code associated with the place. */ countryCode: string; + + administrativeArea: string | undefined; + administrativeAreaCode: string | undefined; + areasOfInterest: string[] | undefined; + country: string | undefined; + dependentLocalities: string[] | undefined; + fullThoroughfare: string | undefined; + locality: string | undefined; + pointOfInterestCategory: PointOfInterestCategory; + postCode: string | undefined; + subLocality: string | undefined; + subThoroughfare: string | undefined; + thoroughfare: string | undefined; } } From 54d7ea68faaa01d634f17fc3d4a03f919dd0180b Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Mon, 8 Jun 2020 18:37:06 +0200 Subject: [PATCH 6/8] Update GeoJSON --- mapkit/mapkit.GeoJSON.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapkit/mapkit.GeoJSON.d.ts b/mapkit/mapkit.GeoJSON.d.ts index 87a46e1..c4f1fae 100644 --- a/mapkit/mapkit.GeoJSON.d.ts +++ b/mapkit/mapkit.GeoJSON.d.ts @@ -30,7 +30,7 @@ declare namespace mapkit { * @param geoJSON The original GeoJSON object for this feature. */ itemForFeature?( - item: mapkit.Annotation | mapkit.Overlay | null, + item: mapkit.Annotation | mapkit.Overlay | mapkit.ItemCollection | null, geoJSON: object, ): mapkit.Annotation | mapkit.Overlay | Array; /** From 26d6e7c0ae473042b2d8c9b13b4f36cefb327d7d Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Thu, 11 Jun 2020 21:32:28 +0200 Subject: [PATCH 7/8] Set tslint array-type to match codebase --- tslint.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tslint.json b/tslint.json index 7a4df45..d9a903b 100644 --- a/tslint.json +++ b/tslint.json @@ -4,6 +4,7 @@ "exclude": ["test/**", "node_modules/**"] }, "rules": { + "array-type": [true, "array-simple"], "interface-name": [true, "never-prefix"], "max-classes-per-file": false, "max-line-length": [true, 100], From b6d4c615c3087c3428d453b5037449a17cc3c7d7 Mon Sep 17 00:00:00 2001 From: 0bmxa <0bmxa@users.noreply.github.com> Date: Thu, 11 Jun 2020 22:51:08 +0200 Subject: [PATCH 8/8] Fix PointOfInterestFilter instance methods --- mapkit/mapkit.Map.d.ts | 91 +++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/mapkit/mapkit.Map.d.ts b/mapkit/mapkit.Map.d.ts index f83fef4..d3531e7 100644 --- a/mapkit/mapkit.Map.d.ts +++ b/mapkit/mapkit.Map.d.ts @@ -596,56 +596,57 @@ declare namespace mapkit { maxCameraDistance: number; } - interface PointOfInterestFilter { - excludesCategory(category: PointOfInterestCategory): boolean; - excluding(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; - includesCategory(category: PointOfInterestCategory): boolean; - including(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; + class PointOfInterestFilter { + private constructor(); + static excludesCategory(category: PointOfInterestCategory): boolean; + static excluding(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; + static includesCategory(category: PointOfInterestCategory): boolean; + static including(categoryList: PointOfInterestCategory[]): PointOfInterestFilter; filterExcludingAllCategories: PointOfInterestFilter; filterIncludingAllCategories: PointOfInterestFilter; } interface PointOfInterestCategory { - Airport: string; - AmusementPark: string; - Aquarium: string; - ATM: string; - Bakery: string; - Bank: string; - Beach: string; - Brewery: string; - Cafe: string; - Campground: string; - CarRental: string; - EVCharger: string; - FireStation: string; - FitnessCenter: string; - FoodMarket: string; - GasStation: string; - Hospital: string; - Hotel: string; - Laundry: string; - Library: string; - Marina: string; - MovieTheater: string; - Museum: string; - NationalPark: string; - Nightlife: string; - Park: string; - Parking: string; - Pharmacy: string; - Police: string; - PostOffice: string; - PublicTransport: string; - Restaurant: string; - Restroom: string; - School: string; - Stadium: string; - Store: string; - Theater: string; - University: string; - Winery: string; - Zoo: string; + readonly Airport: string; + readonly AmusementPark: string; + readonly Aquarium: string; + readonly ATM: string; + readonly Bakery: string; + readonly Bank: string; + readonly Beach: string; + readonly Brewery: string; + readonly Cafe: string; + readonly Campground: string; + readonly CarRental: string; + readonly EVCharger: string; + readonly FireStation: string; + readonly FitnessCenter: string; + readonly FoodMarket: string; + readonly GasStation: string; + readonly Hospital: string; + readonly Hotel: string; + readonly Laundry: string; + readonly Library: string; + readonly Marina: string; + readonly MovieTheater: string; + readonly Museum: string; + readonly NationalPark: string; + readonly Nightlife: string; + readonly Park: string; + readonly Parking: string; + readonly Pharmacy: string; + readonly Police: string; + readonly PostOffice: string; + readonly PublicTransport: string; + readonly Restaurant: string; + readonly Restroom: string; + readonly School: string; + readonly Stadium: string; + readonly Store: string; + readonly Theater: string; + readonly University: string; + readonly Winery: string; + readonly Zoo: string; } }