src/modules/generic-search/classes/generic-search.service.intf.ts
Service to implement to use the Generic Search.
Methods |
|
Optional createNew |
createNew()
|
Prepares everything that is needed for creating a new item
Returns :
void
|
getSearchState |
getSearchState()
|
Fetch the current search state from Redux The Redux search state |
resetSearchState |
resetSearchState()
|
Reset the current search state in Redux
Returns :
void
|
import { Observable } from "rxjs";
import { StarkSearchState } from "../entities";
/**
* Service to implement to use the Generic Search.
*/
export interface StarkGenericSearchService<SearchResultsType, CriteriaType> {
/**
* Prepares everything that is needed for creating a new item
*/
createNew?(): void;
/**
* Fetch the current search state from Redux
* @returns The Redux search state
*/
getSearchState(): Observable<StarkSearchState<CriteriaType>>;
/**
* Reset the current search state in Redux
*/
resetSearchState(): void;
/**
* Performs the search with the given criteria
* @param criteria - The search criteria
* @returns The search results
*/
search(criteria: CriteriaType): Observable<SearchResultsType[]>;
}