import { HttpParams, HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs'; /** * Http service to interact with backend api * Injectable - will be available in overall the application scope */ export declare class HttpService { private http; /** * Creates an instance of http service. * @param http Http backend handler to by pass interceptors */ constructor(http: HttpClient); /** * Gets headers * @param token Auth token * @returns Http headers */ private getHeaders; /** * Formats errors * @param error Error received in api response * @returns Throw error after some processing */ private handleErrors; /** * Gets http service * @template T Generic type template * @param token Auth token * @param path Api end point * @param [params] Http parameters * @param headers Http headers * @returns Api response with status codes */ get(token: string, path: string, params?: HttpParams, headers?: HttpHeaders): Observable; /** * Posts http service * @template T Generic type template * @param token Auth token * @param path Api end point * @param [body] Post data * @param headers Http headers * @returns api Response with status codes */ post(token: string, path: string, body?: Object, headers?: HttpHeaders): Observable; /** * Puts http service * @template T Generic type template * @param token Auth token * @param path Api end point * @param [body] Post data * @param headers Http headers * @returns Api response with status codes */ put(token: string, path: string, body?: object, headers?: HttpHeaders): Observable; /** * Patch http service * @template T Generic type template * @param token Auth token * @param path Api end point * @param [body] Post data * @param headers Http headers * @returns Api response with status codes */ patch(token: string, path: string, body?: object, headers?: HttpHeaders): Observable; /** * Deletes http service * @template T Generic type template * @param token Auth token * @param path Api end point * @param headers Http headers * @returns Api response with status codes */ delete(token: string, path: string, headers?: HttpHeaders): Observable; }