mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4090 from adrienkohlbecker/master
Add google places AutocompleteService
This commit is contained in:
Vendored
+49
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user