import { ControlValueAccessor } from '@angular/forms'; import { NgZone } from '@angular/core'; /** * Component providing a searchbar input which autocomplete returned by Google Maps API * * @example * */ export declare class AddressInputComponent implements ControlValueAccessor { private ngZone; /** * The component needs a label option to fill the placeholder */ label: string; /** * 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); /** * Empties the propositions list. * Called before its filling or when there are not results from Google services */ private setList(results?); /** * 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(); /** * 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(): 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; /** * 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; }