Add google places AutocompleteService

This commit is contained in:
Adrien Kohlbecker
2015-04-11 15:38:52 +02:00
parent 528debd5fd
commit 1a3e3a11f4
+49
View File
@@ -1345,6 +1345,55 @@ declare module google.maps {
}
export module places {
export class AutocompleteService extends MVCObject {
constructor();
getPlacePredictions(request: AutocompletionRequest, callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void): void;
getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void;
}
export interface AutocompletionRequest {
input: string;
bounds?: LatLngBounds;
componentRestrictions?: ComponentRestrictions;
location?: LatLng;
offset?: number;
radius?: number;
types?: string[];
}
export interface QueryAutocompletionRequest {
input: string;
bounds?: LatLngBounds;
location?: LatLng;
offset?: number;
radius?: number;
}
export interface AutocompletePrediction {
description: string;
matched_substrings: PredictionSubstring[];
place_id: string;
terms: PredictionTerm[];
types: string[]
}
export interface PredictionTerm {
offset: number;
value: string;
}
export interface PredictionSubstring {
length: number;
offset: number;
}
export interface QueryAutocompletePrediction {
description: string;
matched_substrings: PredictionSubstring[];
place_id: string;
terms: PredictionTerm[];
}
export class Autocomplete extends MVCObject {
constructor (inputField: HTMLInputElement, opts?: AutocompleteOptions);