UNPKG

@knora/search

Version:
46 lines (45 loc) 1.62 kB
import { OnDestroy, OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { KnoraApiConnection, ReadResource } from '@knora/api'; import { OntologyCacheService, PropertyValue, Value } from '@knora/core'; export declare class LinkValueComponent implements OnInit, OnDestroy, PropertyValue { private knoraApiConnection; private fb; private _cacheService; formGroup: FormGroup; type: string; form: FormGroup; resources: ReadResource[]; private _restrictToResourceClass; restrictResourceClass: string; constructor(knoraApiConnection: KnoraApiConnection, fb: FormBuilder, _cacheService: OntologyCacheService); /** * Displays a selected resource using its label. * * @param resource the resource to be displayed (or no selection yet). * @returns */ displayResource(resource: ReadResource | null): string; /** * Search for resources whose labels contain the given search term, restricting to to the given properties object constraint. * * @param searchTerm */ searchByLabel(searchTerm: string): void; /** * Checks that the selection is a [[ReadResource]]. * * Surprisingly, [null] has to be returned if the value is valid: https://angular.io/guide/form-validation#custom-validators * * @param the form element whose value has to be checked. * @returns */ validateResource(c: FormControl): { noResource: { value: any; }; }; ngOnInit(): void; ngOnDestroy(): void; getValue(): Value; }