import { EventEmitter, OnChanges } from '@angular/core'; import { PageEvent } from '@angular/material/paginator'; import { IFulltextSearchParams, KnoraApiConnection, ReadResourceSequence } from '@dasch-swiss/dsp-js'; import { NotificationService } from '../../../action/services/notification.service'; import { AdvancedSearchParamsService } from '../../../search/services/advanced-search-params.service'; /** * query: search query. It can be gravserch query or fulltext string query. * The query value is expected to have at least length of 3 characters. * * mode: search mode "fulltext" OR "gravsearch" * * filter: Optional fulltext search parameter with following (optional) properties: * - limitToResourceClass: string; Iri of resource class the fulltext search is restricted to, if any. * - limitToProject: string; Iri of the project the fulltext search is restricted to, if any. * - limitToStandoffClass: string; Iri of standoff class the fulltext search is restricted to, if any. */ export interface SearchParams { query: string; mode: 'fulltext' | 'gravsearch'; filter?: IFulltextSearchParams; } export interface ShortResInfo { id: string; label: string; } export interface FilteredResources { count: number; resListIndex: number[]; resInfo: ShortResInfo[]; selectionType: 'multiple' | 'single'; } export interface CheckboxUpdate { checked: boolean; resIndex: number; resId: string; resLabel: string; isCheckbox: boolean; } export declare class ListViewComponent implements OnChanges { private _dspApiConnection; private _advancedSearchParamsService; private _notification; search: SearchParams; view?: 'list' | 'grid'; displayViewSwitch?: boolean; /** * Set to true if multiple resources can be selected for comparison */ withMultipleSelection?: boolean; /** * Emits the selected resources 1-n */ selectedResources: EventEmitter; /** * @deprecated Use selectedResources instead * * Click on checkbox will emit the resource info * * @param {EventEmitter} resourcesSelected */ multipleResourcesSelected?: EventEmitter; /** * @deprecated Use selectedResources instead * * Click on an item will emit the resource iri * * @param {EventEmitter} singleResourceSelected */ singleResourceSelected?: EventEmitter; /** * @deprecated Use selectedResources instead. * Click on an item will emit the resource iri */ resourceSelected: EventEmitter; resources: ReadResourceSequence; selectedResourceIdx: number[]; resetCheckBoxes: boolean; pageEvent: PageEvent; numberOfAllResults: number; loading: boolean; constructor(_dspApiConnection: KnoraApiConnection, _advancedSearchParamsService: AdvancedSearchParamsService, _notification: NotificationService); ngOnChanges(): void; /** * * @param view 'list' | ' grid'; TODO: will be expanded with 'table' as soon as resource-table component is done */ toggleView(view: 'list' | 'grid'): void; emitSelectedResources(res?: FilteredResources): void; goToPage(page: PageEvent): void; /** * do the search and send the resources to the child components * like resource-list, resource-grid or resource-table */ private _doSearch; }