angular-table-searcher
Version:
This is an angular table searcher. it helps to use keys provided to search through a list of objects and if no keys are provided, it searches for the occurrence of the input value. it also makes request to endpoint if url is provided for backend search.
54 lines (53 loc) • 1.82 kB
TypeScript
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/throw';
import 'rxjs/add/observable/from';
import { HttpClient } from "@angular/common/http";
export declare class TableSearcherService {
private http;
private searched;
constructor(http: HttpClient);
/**
* This is used to initialize searching of data from the object passed.
* @param {Array<Object>} values
* @param toFind
* @param {Array<string>} keys
* @returns {Array<Object>}
*/
initSearch(values: Array<Object>, toFind?: string, keys?: Array<string>): Observable<any>;
/**
* This is used to start the search after initialization has taken place.
* @param {Array<Object>} values
* @param toFind
* @param {string} key
*/
private startSearching(values, toFind, key?);
/**
* This is used to start an object search for the input values toFind.
* @param {Object} values
* @param {string} toFind
* @param {string} key
* @returns {boolean}
*/
private processObject(values, toFind, key?);
/**
* This is used to filter depth object having multiple level objects or arrays
* @param {Array<any>} values
* @param {string} toFind
* @param {Array<string>} keys
* @returns {boolean}
*/
private processArray(values, toFind, keys?);
/**
* This is used to compare if data lookup is valid or not
* @param {string} value
* @param {string} toFind
* @param {Array<string>} keys
* @returns {boolean}
*/
private processValidation(value, toFind, keys?);
/**
* This is used to search backend if empty list is encountered.
* @returns {Observable<any>}
*/
searchResource(url: any): Observable<any>;
}