/** * XMLHttpRequest module used to send Http requests to listeners. */ import { Response } from '../models'; export declare class HttpUtil { /** * HttpGet method. * @param url Endpoint to hit. * @param transform Method to transform http response string to desired object. */ static get(url: string, transform: (response: any) => T): Promise>; /** * HttpPost method. * @param url Endpoint to hit. * @param transform Method to transform http response string to desired object. * @param data Data to post. */ static post(url: string, transform: (response: any) => T, data?: any): Promise>; static httpRequest(url: string, transform: (response: any) => T, method: string, data?: any): Promise>; /** * Converts response data into error model if the call failed safely. * @param httpResponse response data */ static errorResponse(httpResponse: any): string; /** * Checks for existing token in local storage and adds it to outgoing request headers. * @param request The request to which the token will be added as header. */ static addTokenToHeader(request: XMLHttpRequest): void; /** * Reads all response headers if token is present, sets token to local storage. * @param request request containing the response headers. */ static persistTokentoLocalStorage(request: XMLHttpRequest): void; }