import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { AbstractControl, FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { CreateGeonameValue, ReadGeonameValue, UpdateGeonameValue } from '@dasch-swiss/dsp-js'; import { Observable, Subscription } from 'rxjs'; import { BaseValueComponent } from '../base-value.component'; import { ValueErrorStateMatcher } from '../value-error-state-matcher'; import { DisplayPlace, GeonameService, SearchPlace } from '../../services/geoname.service'; export declare function geonameIdValidator(control: AbstractControl): { invalidType: { value: any; }; }; export declare class GeonameValueComponent extends BaseValueComponent implements OnInit, OnChanges, OnDestroy { private _fb; private _geonameService; displayValue?: ReadGeonameValue; valueFormControl: FormControl; commentFormControl: FormControl; form: FormGroup; valueChangesSubscription: Subscription; matcher: ValueErrorStateMatcher; customValidators: (typeof geonameIdValidator)[]; $geonameLabel: Observable; places: SearchPlace[]; constructor(_fb: FormBuilder, _geonameService: GeonameService); standardValueComparisonFunc(initValue: { id: string; }, curValue: { id: string; } | null): boolean; getInitValue(): { id: string; } | null; /** * Used to create a value which is displayed to the user after selection from autocomplete. * * @param place the user selected place. */ displayPlaceInSearch(place: SearchPlace | null): string; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; getNewValue(): CreateGeonameValue | false; getUpdatedValue(): UpdateGeonameValue | false; }