mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-26 06:05:54 +08:00
updated places sub-module for google.maps
This commit is contained in:
76
googlemaps/google.maps.d.ts
vendored
76
googlemaps/google.maps.d.ts
vendored
@@ -470,7 +470,7 @@ declare module google.maps {
|
||||
visible?: boolean;
|
||||
zIndex?: number;
|
||||
}
|
||||
|
||||
|
||||
export enum StrokePosition {
|
||||
CENTER,
|
||||
INSIDE,
|
||||
@@ -1414,8 +1414,19 @@ declare module google.maps {
|
||||
country: string;
|
||||
}
|
||||
|
||||
export interface PhotoOptions {
|
||||
maxHeight?: number;
|
||||
maxWidth?: number;
|
||||
}
|
||||
|
||||
export interface PlaceAspectRating {
|
||||
rating: number;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface PlaceDetailsRequest {
|
||||
reference: string;
|
||||
placeId: string;
|
||||
reference?: string;
|
||||
}
|
||||
|
||||
export interface PlaceGeometry {
|
||||
@@ -1423,29 +1434,53 @@ declare module google.maps {
|
||||
viewport: LatLngBounds;
|
||||
}
|
||||
|
||||
export interface PlacePhoto {
|
||||
height: number;
|
||||
html_attributions: string[];
|
||||
width: number;
|
||||
getUrl(opts: PhotoOptions): string;
|
||||
}
|
||||
|
||||
export interface PlaceResult {
|
||||
address_components: GeocoderAddressComponent[];
|
||||
aspects: PlaceAspectRating[];
|
||||
formatted_address: string;
|
||||
formatted_phone_number: string;
|
||||
geometry: PlaceGeometry;
|
||||
html_attributions: string[];
|
||||
icon: string;
|
||||
id: string;
|
||||
id?: string;
|
||||
international_phone_number: string;
|
||||
name: string;
|
||||
permanently_closed: boolean;
|
||||
photos: PlacePhoto[];
|
||||
place_id: string;
|
||||
price_level: number;
|
||||
rating: number;
|
||||
reference: string;
|
||||
reference?: string;
|
||||
reviews: PlaceReview[];
|
||||
types: string[];
|
||||
url: string;
|
||||
vicinity: string;
|
||||
website: string;
|
||||
}
|
||||
|
||||
export interface PlaceReview {
|
||||
aspects: PlaceAspectRating[];
|
||||
author_name: string;
|
||||
author_url: string;
|
||||
language: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface PlaceSearchRequest {
|
||||
bounds: LatLngBounds;
|
||||
keyword: string;
|
||||
location: LatLng;
|
||||
maxPriceLevel?: number;
|
||||
minPriceLevel?: number;
|
||||
name: string;
|
||||
openNow: boolean;
|
||||
radius: number;
|
||||
rankBy: RankBy;
|
||||
types: string[];
|
||||
@@ -1461,6 +1496,7 @@ declare module google.maps {
|
||||
constructor (attrContainer: Map);
|
||||
getDetails(request: PlaceDetailsRequest, callback: (result: PlaceResult, status: PlacesServiceStatus) => void ): void;
|
||||
nearbySearch(request: PlaceSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus, pagination: PlaceSearchPagination) => void ): void;
|
||||
radarSearch(request: RadarSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void ): void;
|
||||
textSearch(request: TextSearchRequest, callback: (results: PlaceResult[], status: PlacesServiceStatus) => void ): void;
|
||||
}
|
||||
|
||||
@@ -1473,27 +1509,37 @@ declare module google.maps {
|
||||
ZERO_RESULTS
|
||||
}
|
||||
|
||||
export interface RadarSearchRequest {
|
||||
bounds: LatLngBounds;
|
||||
keyword: string;
|
||||
location: LatLng;
|
||||
name: string;
|
||||
radius: number;
|
||||
types: string[];
|
||||
}
|
||||
|
||||
export enum RankBy {
|
||||
DISTANCE,
|
||||
PROMINENCE
|
||||
}
|
||||
|
||||
export class SearchBox {
|
||||
constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions);
|
||||
getBounds(): LatLngBounds;
|
||||
setBounds(bounds: LatLngBounds): void;
|
||||
getPlaces(): PlaceResult[];
|
||||
}
|
||||
|
||||
export interface SearchBoxOptions {
|
||||
bounds: LatLngBounds;
|
||||
}
|
||||
export class SearchBox extends MVCObject {
|
||||
constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions);
|
||||
getBounds(): LatLngBounds;
|
||||
setBounds(bounds: LatLngBounds): void;
|
||||
getPlaces(): PlaceResult[];
|
||||
}
|
||||
|
||||
export interface SearchBoxOptions {
|
||||
bounds: LatLngBounds;
|
||||
}
|
||||
|
||||
export interface TextSearchRequest {
|
||||
bounds: LatLngBounds;
|
||||
location: LatLng;
|
||||
query: string;
|
||||
radius: number;
|
||||
types: string[];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1643,6 +1689,6 @@ declare module google.maps {
|
||||
|
||||
export class MapsEventListener {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user