Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 5.44.0 #21

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mapkit/mapkit.Directions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ declare namespace mapkit {
* routes when they are available.
*/
requestsAlternateRoutes?: boolean;

arrivalDate?: Date;
departureDate?: Date;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mapkit/mapkit.GeoJSON.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<mapkit.Annotation | mapkit.Overlay>;
/**
Expand Down
13 changes: 13 additions & 0 deletions mapkit/mapkit.Geocoder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
142 changes: 142 additions & 0 deletions mapkit/mapkit.Map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -449,6 +476,8 @@ declare namespace mapkit {
* A Boolean value that determines whether the user location control is visible.
*/
showsUserLocationControl?: boolean;

pointOfInterestFilter?: mapkit.PointOfInterestFilter;
}

/**
Expand Down Expand Up @@ -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;
}
}
21 changes: 20 additions & 1 deletion mapkit/mapkit.Search.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<Q> = (
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down