UNPKG

1.24 kBTypeScriptView Raw
1import { HttpClient, HttpParams } from '@angular/common/http';
2import { Observable } from 'rxjs';
3import { LocalDataSource } from '../local/local.data-source';
4import { ServerSourceConf } from './server-source.conf';
5export declare class ServerDataSource extends LocalDataSource {
6 protected http: HttpClient;
7 protected conf: ServerSourceConf;
8 protected lastRequestCount: number;
9 constructor(http: HttpClient, conf?: ServerSourceConf | {});
10 count(): number;
11 getElements(): Promise<any>;
12 /**
13 * Extracts array of data from server response
14 * @param res
15 * @returns {any}
16 */
17 protected extractDataFromResponse(res: any): Array<any>;
18 /**
19 * Extracts total rows count from the server response
20 * Looks for the count in the heders first, then in the response body
21 * @param res
22 * @returns {any}
23 */
24 protected extractTotalFromResponse(res: any): number;
25 protected requestElements(): Observable<any>;
26 protected createRequesParams(): HttpParams;
27 protected addSortRequestParams(httpParams: HttpParams): HttpParams;
28 protected addFilterRequestParams(httpParams: HttpParams): HttpParams;
29 protected addPagerRequestParams(httpParams: HttpParams): HttpParams;
30}