import { Observable } from 'rxjs'; import { SearchCriteria } from '../searchCriteria/SearchCriteria'; import { Searcher } from './Searcher'; /** * Utility helper that stream pages of searches into an Observable. * * A streamer will help users to walk through searches without knowing the underlying pagination implementation. */ export declare class PaginationStreamer { /** * The search method, likely to be the search method of entity's repository */ private readonly searcher; /** * Constructor * * @param searcher the searcher repository */ constructor( /** * The search method, likely to be the search method of entity's repository */ searcher: Searcher); /** * Main method of the helper, it streams the results in observable only loading the pages when necessary. * * @param criteria the criteria * @return the observable of entities. */ search(criteria: C): Observable; private searchInternal; } /** * An object that knows how to create a stremer. */ export interface StreamerFactory { /** * It creates a streamer for this searcher. */ streamer(): PaginationStreamer; } /** * An object that knows how to create a stremer from it's own searcher. */ export interface SearcherRepository extends StreamerFactory, Searcher { }