import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; /** * Http service to fetch the data from and post data to API server. * @export * @class HttpService */ export declare class HttpService { private http; constructor(http: HttpClient); /** * Fetches the data from server using http get method. * @param {string} url - API endpoint URL. * @param {{ key: string; value: string }[]} [headers] * @usageNotes headers: { key: string; value: string }[] = [ { key: 'Access-Control-Allow-Origin', value: '*' }, ] * @param {{ key: string; value: string }[]} [params] * @usageNotes params: { key: string; value: string }[] = [ { key: 'page', value: '2' }, ]; * @return {Observable} - returns the response received from server and return type is Observable * @memberof HttpService */ getData(url: string, params?: { key: string; value: string; }[], headers?: { key: string; value: string; }[]): Observable; /** * Post the data to the server using http post method. * @param {string} url - API endpoint URL. * @param {any} body - the data to be posted to the server as a body content. * @param {{ key: string; value: string }[]} [headers] * @usageNotes headers: { key: string; value: string }[] = [ { key: 'Access-Control-Allow-Origin', value: '*' }, ] * @param {{ key: string; value: string }[]} [params] * @usageNotes params: { key: string; value: string }[] = [ { key: 'page', value: '2' }, ]; * @return {Observable} - returns the response received from server and return type is Observable * @memberof HttpService */ postData(url: string, body: any, headers?: { key: string; value: string; }[], params?: { key: string; value: string; }[]): Observable; /** * Update the existing data using http put method. * @param {string} url - API endpoint URL. * @param {any} body - the data to be updated to the server as a body content. * @param {{ key: string; value: string }[]} [headers] * @usageNotes headers: { key: string; value: string }[] = [ { key: 'Access-Control-Allow-Origin', value: '*' }, ] * @param {{ key: string; value: string }[]} [params] * @usageNotes params: { key: string; value: string }[] = [ { key: 'page', value: '2' }, ]; * @return {Observable} - returns the response received from server and return type is Observable * @memberof HttpService */ putData(url: string, body: any, headers?: { key: string; value: string; }[], params?: { key: string; value: string; }[]): Observable; /** * Delete the data from server using http delete method. * @param {string} url - API endpoint URL. * @param body - the data to be deleted from the server as a body content. * @param {{ key: string; value: string }[]} [headers] * @usageNotes headers: { key: string; value: string }[] = [ { key: 'Access-Control-Allow-Origin', value: '*' }, ] * @param {{ key: string; value: string }[]} [params] @ @usageNotes params: { key: string; value: string }[] = [ { key: 'page', value: '2' }, ]; * @return {Observable} - returns the response received from server and return type is Observable * @memberof HttpService */ deleteData(url: string, body?: any, headers?: { key: string; value: string; }[], params?: { key: string; value: string; }[]): Observable; /** * Post FormData (multipart) to the server using http post method. * Does NOT set Content-Type header so the browser can set the correct multipart boundary. * @param {string} url - API endpoint URL. * @param {FormData} formData - the FormData payload. * @param {{ key: string; value: string }[]} [headers] * @param {{ key: string; value: string }[]} [params] * @return {Observable} * @memberof HttpService */ postFormData(url: string, formData: FormData, headers?: { key: string; value: string; }[], params?: { key: string; value: string; }[]): Observable; /** * Utility method to construct the headers that will be passed to the API requests. * @param {({ key: string; value: string }[])} headers - Http headers that will be constructed and passed along with the API requests. * @usageNotes headers: { key: string; value: string }[] = [ { key: 'Access-Control-Allow-Origin', value: '*' }, ] * @return {HttpHeaders} - returns constructed http headers. * @memberof HttpService */ getHeaders(headers: { key: string; value: string; }[]): HttpHeaders; /** * Utility method to construct the params that will be passed to the API requests. * @param {({ key: string; value: string }[])} params - Http headers that will be constructed and passed along with the API requests. * @usageNotes params: { key: string; value: string }[] = [ { key: 'page', value: '2' }, ]; * @return {HttpParams} - returns constructed http params. * @memberof HttpService */ getParams(params: { key: string; value: string; }[]): HttpParams; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }