import { AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core'; import { ScrollDispatcher } from '@angular/cdk/scrolling'; import { Observable } from 'rxjs'; import { NgxMatSelectSearchParams } from '../../select-model'; import { NgxMatSelectComponent } from '../../select'; import { NgxMatSelectFetchOptionsDirective } from './ngx-mat-select-fetch-options'; import * as i0 from "@angular/core"; export declare class NgxMatSelectFetchOptionsServerSideDirective extends NgxMatSelectFetchOptionsDirective implements AfterViewInit, OnDestroy { private scrollDispatcher; /** * the page size, every calculation for figuring out whether there is a next page or not based on this property */ pageSize: number; /** * to fetch the options from the server through searchParams */ set fetchOptions(fetchFunction: (searchParams: NgxMatSelectSearchParams) => Observable); /** * to store the previous options to use them after coming back to the old pages * @private */ protected options: unknown[]; /** *This would store the current page number that we are in it, * it stats from one * @private */ private pageNumber; /** * an observable to force the main stream to get the new data filtered through searchTerm * @private */ private search$; /** * an observable to force the main stream to get next page data according to the pageNumber * @private */ private fetchNext$; /** * if it's false when getting the next page request comes the request will be blocked * before sending to the server * @private */ private hasMore; constructor(changeDetectorRef: ChangeDetectorRef, host: NgxMatSelectComponent, scrollDispatcher: ScrollDispatcher); /** * to search the options with the searchTerm * @param searchTerm */ search: (searchTerm: string) => void; /** * to fetch the next page if any */ fetchNext(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * to sort the selected items according to the provided sortComparator function */ protected sortValues: () => void; /** * Actually in the server-side mode we would not be able to sync options with values * in order to omit non-exist values through the received options, * because we don't have all options available at once, so we don't have * any indicator to distinguish between them, so whatever value is provided would be set as the selected option */ protected syncValueAndOptions: () => void; /** * to listen to the virtual scroll events, and get the next page at the appropriate time. * @private */ private initializeInfiniteScroll; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }