import { AjaxRequest } from 'rxjs/ajax'; /** * `TypedAjaxRequest` is identical to an ordinary `AjaxRequest` by **rxjs**, * it just transports type information for the request and response body. */ export interface TypedAjaxRequest extends AjaxRequest { } /** * Request Method. */ export declare enum Method { GET = "GET", POST = "POST", PUT = "PUT", PATCH = "PATCH", DELETE = "DELETE" } /** * Response Type. */ export declare enum ResponseType { JSON = "json", TEXT = "text", BLOB = "blob" } /** * Defines a request builder. */ export interface Request { /** * Sets the url for the request. * * @param url URL. */ url(url: string): Request; /** * Sets the request method. * * @see Method * @param method Method. */ method(method: Method): Request; /** * Sets the response type. * * @see ResponseType * @param responseType Response type. */ responseType(responseType: ResponseType): Request; /** * Sets the data (body). * * @param body Body. */ data(body: Data): Request; /** * Sets the value of a specific header. * Undefined as value will delete the current header value. * * @param name Name. * @param value Value. */ header(name: string, value: string | undefined): Request; /** * Sets a group of headers and their values. * Undefined values will delete the corresponding header value. * * @param headers Headers. */ headers(headers: Record): Request; /** * Sets the user. * * @param user User. */ user(user: string | undefined): Request; /** * Sets the password. * * @param password Password. */ password(password: string | undefined): Request; /** * Sets the credentials flags. * * @param withCredentials Credentials flag. */ withCredentials(withCredentials: boolean): Request; /** * Gets the actual request object. */ get(): TypedAjaxRequest; } export declare function request(configuration?: TypedAjaxRequest): Request;