import { Either, Maybe } from "../external/sanctuary/Sanctuary"; export declare const LOADER_TYPE_XHR = "xhr"; export declare enum LoaderXhrResponseType { BLOB = "blob", ARRAYBUFFER = "arraybuffer", DOCUMENT = "document", JSON = "json", TEXT = "text", } export declare enum LoaderXhrRequestMethod { GET = "GET", POST = "POST", PUT = "PUT", DELETE = "DELETE", } export declare enum LoaderXhrRequestType { PLAIN = "plain", FORM = "form", MULTIPART = "multipart", } export interface LoaderXhrRequest { url: string; args: any; logError: boolean; method: LoaderXhrRequestMethod; requestType: LoaderXhrRequestType; responseType: LoaderXhrResponseType; headers?: Array<[string, string]>; __loaderType: string; } export interface LoaderXhrResponse { data: any; statusCode: number; success: boolean; __loaderType: string; } export declare type LoaderXhrCallback = (resp: Either) => void; export declare type LoaderXhrStatus = Maybe | Either; export declare class LoaderXhr { private currentRequest; private _status; private xhr; __loaderType: string; constructor(_req?: Partial, _callback?: LoaderXhrCallback); load(_req: Partial, _callback?: LoaderXhrCallback): LoaderXhrStatus; readonly status: LoaderXhrStatus; close(): void; } export declare const loadXhrPromise: (req: Partial) => Promise>; export declare const loadXhrFactory: (req: Partial, callback?: LoaderXhrCallback) => LoaderXhr; export declare const isLoaderXhr: (arg: any) => arg is LoaderXhr;