import { ReplaySubject } from "rxjs"; import { OnDestroy, OnInit } from "@angular/core"; import { UntypedFormGroup } from "@angular/forms"; import { AbstractStarkFormComponent } from "./abstract-form-component"; import { StarkGenericSearchService } from "./generic-search.service.intf"; import { StarkLoggingService } from "@nationalbankbelgium/stark-core"; import { StarkProgressIndicatorConfig, StarkProgressIndicatorService } from "@nationalbankbelgium/stark-ui/src/modules/progress-indicator"; import * as i0 from "@angular/core"; /** * Abstract class defining the common properties and methods for the Search Page using the {@link StarkGenericSearchComponent}. */ export declare abstract class AbstractStarkSearchComponent extends AbstractStarkFormComponent implements OnInit, OnDestroy { protected genericSearchService: StarkGenericSearchService; protected progressService: StarkProgressIndicatorService; /** * Whether a new search should be performed automatically after initialization in case the last search criteria can be fetched * from the application state (@ngrx/store) */ protected performSearchOnInit: boolean; /** * Whether the latest emitted results by the emitResult() method will be kept in the latestResults variable */ protected preserveLatestResults: boolean; /** * The config of the progress indicator to be shown/hidden when performing the search. */ progressIndicatorConfig: StarkProgressIndicatorConfig; /** * Observable that will emit the search results. This Observable is created as soon as the Search Page controller is constructed * and the first value it emits is an empty array in order to avoid the having undefined values passed down to the subscriber(s). */ results$: ReplaySubject; /** * Class constructor * @param genericSearchService - Service implementing the StarkGenericSearchService interface providing all the necessary methods to search items. * @param logger - The `StarkLoggingService` instance of the application. * @param progressService - Service that provides an easy way to change the visibility of a progress indicator. */ constructor(genericSearchService: StarkGenericSearchService, logger: StarkLoggingService, progressService: StarkProgressIndicatorService); /** * Component lifecycle hook */ ngOnInit(): void; /** * Component lifecycle hook */ ngOnDestroy(): void; /** * Invoke the search passing the formGroup's working copy only if the Search formGroup is valid * @param formGroup - The 'search' formGroup */ onSearch(formGroup: UntypedFormGroup): void; /** * Invoke the genericSearchService.createNew() method */ onNew(): void; /** * Invoke the genericSearchService.resetSearchState() method and clears the results * @param form - Form to reset */ onReset(form: UntypedFormGroup): void; /** * Update the current working copy of the searchCriteria * @param searchCriteria - New value of searchCriteria */ updateWorkingCopy(searchCriteria: CriteriaType): void; /** * Invoke the genericSearchService.search() method and emits the results. If no searchCriteria object is passed, then the current * form's working copy is used. * @param searchCriteria - Criteria to be used to perform the search */ performSearch(searchCriteria?: CriteriaType): void; /** * The latest search results that have been emitted in the results$ Observable. */ get latestResults(): Readonly | undefined; /** * Call the progressService show/hide methods in case there is a progressTopic defined * @param show - Whether to show the progress indicator or not */ protected showProgress(show: boolean): void; /** * Emit the latest results and optionally keeps a reference to them if the preserveLatestResults option is enabled. * @param result - Result to emit */ protected emitResult(result: SearchResultsType[]): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, {}, {}, never, never, false, never>; }