UNPKG

1.18 kBTypeScriptView Raw
1declare namespace google.maps.places {
2 class Autocomplete extends MVCObject {
3 constructor(inputField: HTMLInputElement, opts?: AutocompleteOptions);
4 getBounds(): LatLngBounds;
5 getPlace(): PlaceResult;
6 setBounds(bounds: LatLngBounds | LatLngBoundsLiteral): void;
7 setComponentRestrictions(restrictions: ComponentRestrictions): void;
8 setFields(fields: string[] | undefined): void;
9 setOptions(options: AutocompleteOptions): void;
10 setTypes(types: string[]): void;
11 }
12
13 interface AutocompleteOptions {
14 bounds?: LatLngBounds | LatLngBoundsLiteral;
15 componentRestrictions?: ComponentRestrictions;
16 placeIdOnly?: boolean;
17 strictBounds?: boolean;
18 types?: string[];
19 type?: string;
20 fields?: string[];
21 }
22
23 class SearchBox extends MVCObject {
24 constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions);
25 getBounds(): LatLngBounds;
26 getPlaces(): PlaceResult[];
27 setBounds(bounds: LatLngBounds | LatLngBoundsLiteral): void;
28 }
29
30 interface SearchBoxOptions {
31 bounds: LatLngBounds | LatLngBoundsLiteral;
32 }
33}