import request from 'superagent'; import { HTTPMethod } from './types/http'; export declare class AjaxRequester { static Get(url: string, options?: { headers?: {}; query?: {}; }): Promise; /** * @param url * @param options * @returns The response body as JSON object. Losing other metadata in the response. */ static GetJson(url: string, options?: { headers?: {}; query?: {}; }): Promise; /** * * @param url * @param options * @returns The response body as JSON object. Losing other metadata in the response. */ static GetArrayBuffer(url: string, options?: { headers?: {}; query?: {}; }): Promise; static Post(url: string, options?: { headers?: {}; query?: {}; body?: {}; }): Promise; static PostJson(url: string, options?: { headers?: {}; query?: {}; body?: {}; }): Promise; /** * * @param url * @param options * @param method * @returns A type that extends `Promise`, so you can use `await` keyword directly * in front of the function call to get the response object, as if it is an async function. Of course, * you can also chain other methods to add additional options to the request before sending it. */ static Ajax(url: string, options?: { headers?: {}; query?: {}; body?: {}; }, method?: HTTPMethod): request.SuperAgentRequest; /** * Takes an object and returns a representation that is compatible with superagent set(). * Nested objects are converted to JSON. */ static normalizeHeaders(obj: { [index: string]: any; }): Record; }