import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { AbstractControl, FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { CreateLinkValue, KnoraApiConnection, ReadLinkValue, ReadResource, UpdateLinkValue } from '@dasch-swiss/dsp-js'; import { Subscription } from 'rxjs'; import { BaseValueComponent } from '../base-value.component'; export declare function resourceValidator(control: AbstractControl): { invalidType: { value: any; }; }; export declare class LinkValueComponent extends BaseValueComponent implements OnInit, OnChanges, OnDestroy { private _fb; private _dspApiConnection; displayValue?: ReadLinkValue; parentResource: ReadResource; propIri: string; referredResourceClicked: EventEmitter; referredResourceHovered: EventEmitter; resources: ReadResource[]; restrictToResourceClass: string; valueFormControl: FormControl; commentFormControl: FormControl; form: FormGroup; valueChangesSubscription: Subscription; labelChangesSubscription: Subscription; customValidators: (typeof resourceValidator)[]; constructor(_fb: FormBuilder, _dspApiConnection: KnoraApiConnection); /** * Displays a selected resource using its label. * * @param resource the resource to be displayed (or no selection yet). */ displayResource(resource: ReadResource | null): string; /** * Search for resources whose labels contain the given search term, restricting to to the given properties object constraint. * this is to be used for update and new linked resources * * @param searchTerm label to be searched */ searchByLabel(searchTerm: string): void; getInitValue(): ReadResource | null; standardValueComparisonFunc(initValue: ReadResource, curValue: ReadResource | string | null): boolean; ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; getNewValue(): CreateLinkValue | false; getUpdatedValue(): UpdateLinkValue | false; /** * Emits the displayValue on click. */ refResClicked(): void; /** * Emits the displayValue on hover. */ refResHovered(): void; }