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; } /** 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; /** 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; } } diff --git a/mapkit/mapkit.Map.d.ts b/mapkit/mapkit.Map.d.ts index 255839c..d3531e7 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,117 @@ 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; + } + + 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 { + 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; + } } 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; + } } 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", 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],