import { NgZone } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { NavParams, Searchbar, ViewController } from 'ionic-angular'; /** * Component providing a searchbar input which autocomplete returned by Google Maps API * * @example * //TODO */ export declare class AddressAutocompleteModalComponent implements ControlValueAccessor { private ngZone; private params; private viewCtrl; searchBar: Searchbar; /** * Boolean that indicates if the "custom address he typed could be presented on the list" */ allowCustom: boolean; /** * Boolean that indicates if user can validate the "custom address he typed or not" */ customEnabled: boolean; /** * The component needs a label option to fill the placeholder */ label: string; /** * Boolean that indicates if the component will return the full detailed address or not. */ private fullAddressDetails; /** * The component needs a model (ngModel od formControlName) option that will store the returned address */ private _addressValue; /** * {string} Address formatted as it will appear in the dom */ private _displayedAddressValue; /** * True if the input address will be used as is */ private useInputAddress; /** * Google autocomplete service */ private autocompleteService; /** * Google place service */ private placeService; /** * Google geocoder service */ private geocoder; /** * Results received from Google services */ private results; private addressValue; private displayedAddressValue; constructor(ngZone: NgZone, params: NavParams, viewCtrl: ViewController); ionViewDidEnter(): void; /** * Empties the propositions list. * Called before its filling or when there are not results from Google services */ private setList(results?); /** * When the input loses the focus, this method is called to hide the propositions list. */ onBlur(): void; /** * This method is part of ControlValueAccessor interface. * Its role is to set value from the model to the DOM * * @param value Value given from the model */ writeValue(value: any): void; /** * This method is part of ControlValueAccessor interface. * Its role is to set the function that will propagate changes from the DOM to the model. * * @param fn {function} Angular internal function */ registerOnChange(fn: any): void; /** * This method is part of ControlValueAccessor interface. * Not used here */ registerOnTouched(): void; /** * Container for the propagation function. */ propagateChange: (_: any) => void; /** * When user type something in the searchbar, * this method updates the formatted address of the address model. * This also calls the method responsible of filling the propositions list with AutocompleteService. */ inputOnSearchbar(disableCustom: boolean): void; /** * This method calls the autocomplete service to get predictions based on the input value. * If there are some results, they wil fill the propositions list. * Else, Google geocoding will be called */ private useAutocompleteservice(); /** * This method calls the Google geocoding to get predictions based on the input value. * If there are some results, they wil fill the propositions list. */ private useGeocoding(); /** * This method is called when the user validates input without any result, * the address only contains the formatted address entered in the search bar */ selectCustomAddress(): void; /** * This method is called when user select a proposition in the list. * The Google PlaceService is called to get precise informations about this place. * the address object is built with those informations. * * @param item Selected item from propositon list */ selectSearchResult(item: any): void; closeModal(): void; }