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 AutocompleteModalComponent implements ControlValueAccessor { private params; private viewCtrl; searchBar: Searchbar; /** * Full list of results */ list: T[]; /** * Boolean that indicates if the "custom address he typed could be presented on the list" */ allowCustom: boolean; /** * The component needs a label option to fill the placeholder */ label: string; /** * Boolean that indicates if user can validate the "custom address he typed or not" */ customEnabled: boolean; /** * Function returning an html string for item displaying */ display: Function; /** * Function returning a filtered array */ filter: Function; /** * Function returning an object ffrom a string */ factory: Function; /** * The component needs a model (ngModel od formControlName) option that will store the returned address */ private _itemValue; /** * {string} Item formatted as it will appear in the dom */ private _displayedItemValue; /** * Filterd list */ private results; private itemValue; private displayedItemValue; constructor(params: NavParams, viewCtrl: ViewController); ionViewDidEnter(): void; /** * Empties the propositions list. * Called before its filling or when there are not results from Google services */ private setFilteredList(results?); /** * 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: T): 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(onInput: boolean): void; /** * This method is called when the user validates input without any result, * the address only contains the formatted address entered in the search bar */ selectCustomItem(): 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; }