export declare function decodeUrlQuery(queryStr: string): { [key: string]: string; }; export declare function encodeUrlQuery(query: any): string; export declare class HttpResponse { private _xhr; constructor(xhr: XMLHttpRequest); getHeaders(): string; getHeader(header: string): string | null; getBody(): any; getType(): string; getContentType(): string | null; getText(): string; getJson(): any; getXml(): Document | null; } export interface HttpProgress { loaded: number; total?: number; } export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE"; export type HttpResponseType = "arraybuffer" | "blob" | "document" | "json" | "text"; export declare const authBasic: (login: string, password: string) => (req: HttpRequest) => void; export declare const authJwt: (jwt: string) => (req: HttpRequest) => void; export declare class HttpRequest { static readonly xhrs: HttpRequest[]; static onRequest?: (request: HttpRequest) => void; static onResponse?: (response: HttpResponse) => void; static onError?: (e: Event) => void; static abortAll(): void; private _url?; private _query?; private _method; private _headers; private _timeout?; private _responseType?; private _onProgress?; private _onResponse?; private _onError?; private _xhr?; private _async; private _noCache; get(url: string, query?: Object): this; post(url: string, query?: Object): this; put(url: string, query?: Object): this; patch(url: string, query?: Object): this; del(url: string, query?: Object): this; url(url: string, query?: Object): this; method(method: HttpMethod): this; headers(headers: { [key: string]: string; }): this; use(middleware: (req: HttpRequest) => void): this; timeout(timeout: number): this; responseType(type: HttpResponseType): this; onProgress(onProgress: (progress: HttpProgress) => void): this; onResponse(onResponse: (response: HttpResponse) => void): this; onError(onError: (e?: Event) => void): this; async(async?: boolean): this; noCache(noCache?: boolean): this; abort(): this; send(data?: any, contentType?: string): void; sendPromise(data?: any, contentType?: string): Promise; private _send; } export declare function httpGet(url: string, query?: Object): HttpRequest; export declare function httpPost(url: string, query?: Object): HttpRequest; export declare function httpPut(url: string, query?: Object): HttpRequest; export declare function httpPatch(url: string, query?: Object): HttpRequest; export declare function httpDelete(url: string, query?: Object): HttpRequest; export declare function httpOnRequest(onRequest: (req: HttpRequest) => void): void; export declare function httpOnResponse(onResponse: (req: HttpResponse) => void): void; export declare function httpOnError(onError: (req: Event) => void): void; export declare const http: { get: typeof httpGet; post: typeof httpPost; put: typeof httpPut; patch: typeof httpPatch; delete: typeof httpDelete; onRequest: typeof httpOnRequest; onResponse: typeof httpOnResponse; onError: typeof httpOnError; };