@nova-ui/bits
Version:
SolarWinds Nova Framework
50 lines (49 loc) • 1.8 kB
TypeScript
import { DatePipe } from "@angular/common";
import { LoggerService } from "./log-service";
import { ISearchService } from "./public-api";
import * as i0 from "@angular/core";
/**
* <example-url>./../examples/index.html#/common/search-service</example-url>
*/
/**
* Service that provides searching algorithms.
*
* __Name :__
* Search service
*
*/
/**
* @ignore
*/
export declare class SearchService implements ISearchService {
private logger;
private datePipe;
/**
* __Description :__
* Search the value on the items within the given properties.
*
* __Parameters :__
*
* {any[]} items Items to search within.
*
* {string[]} properties Properties where the search is applied. If no property specified, search is
* applied on all fields.
*
* {string|number|date} searchValue The searched value that is used as a string or string fragment. Empty
* string returns the whole array.
*
* {string} [dateFormat="mediumDate"] The Angular date format that is used for searching on Date type
* properties.
*
* return {any[]} Items resulted after the search.
*
*/
constructor(logger: LoggerService, datePipe: DatePipe);
search: <T>(items: T[], properties: string[], searchValue: any, dateFormat?: string) => T[];
protected filterResults<T>(items: T[], properties: string[], searchValue: any, dateFormat?: string): T[];
protected transformDate(value: Date, dateFormat: string | undefined): string | null;
protected filterPredicate(item: any, searchValue: any): boolean;
protected getSearchableColumns: (items: any[]) => string[];
static ɵfac: i0.ɵɵFactoryDeclaration<SearchService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SearchService>;
}