import { RX_HTTP_REQUEST, RX_HTTP_SUCCESS, RX_HTTP_ERROR, RX_HTTP_FINALLY } from './constants'; export declare type RxHttpSuccessGlobalActionType = typeof RX_HTTP_SUCCESS; export declare type RxHttpErrorGlobalActionType = typeof RX_HTTP_ERROR; export declare type RxHttpRequestGlobalActionType = typeof RX_HTTP_REQUEST; export declare type RxHttpFinallyGlobalActionType = typeof RX_HTTP_FINALLY; export declare type RxHttpRequestMode = 'cors' | 'no-cors' | 'same-origin' | 'navigate'; export declare type RxHttpRequestCache = 'default' | 'no-cache' | 'no-store' | 'reload' | 'force-cache'; export interface Dictionary { [key: string]: T; } export declare type HeadersPayload = Dictionary; export declare type RxHttpConfigFactory = (state?: T | void) => RxHttpRequestBase; export declare type RxHttpArgs = Dictionary | undefined; export interface RxHttpStartRequestAction { type: string; args: RxHttpArgs; } export interface RxHttpGlobalSuccessAction { type: RxHttpSuccessGlobalActionType; response: RxHttpResponse; key?: string; args: RxHttpArgs; } export interface RxHttpError { response: Response; body: string | Dictionary; } export interface RxHttpSuccessAction { type: string; result: T; response: Response; args: RxHttpArgs; } export interface RxHttpErrorAction { type: string; error: string | Dictionary; response: Response; args?: RxHttpArgs; } export interface RxHttpGlobalErrorAction { type: RxHttpErrorGlobalActionType; error: RxHttpError; args?: RxHttpArgs; } export interface RxHttpFinallyAction { type: string; args: RxHttpArgs; } export interface RxHttpGlobalFinallyAction { type: RxHttpFinallyGlobalActionType; args: RxHttpArgs; } export interface RxHttpRequestAction { type: RxHttpRequestGlobalActionType; actionTypes: RxHttpActionTypes; request: RxHttpRequest; key?: string; args?: RxHttpArgs; } export declare type RxHttpGlobalActionType = RxHttpSuccessGlobalActionType | RxHttpErrorGlobalActionType | RxHttpRequestGlobalActionType | RxHttpFinallyGlobalActionType; export interface RxHttpRequestActionConfigured extends RxHttpRequestAction { request: RxHttpRequestConfigured; } export interface RxHttpActionTypes { REQUEST: string; SUCCESS: string; ERROR: string; CANCEL: string; FINALLY: string; } export declare type QueryStringable = string | number | boolean | object | undefined | null; export interface RxHttpQueryParams { [key: string]: QueryStringable | QueryStringable[]; } export interface RxHttpRequestConfig { request?: RxHttpRequestBase; args?: RxHttpArgs; key?: string; } export interface RxHttpRequestBase { query?: RxHttpQueryParams | null; body?: any; headers?: HeadersPayload; extraHeaders?: HeadersPayload; mode?: RxHttpRequestMode; cache?: RxHttpRequestCache; baseUrl?: string; json?: boolean; actions?: RxHttpGlobalActionType[]; } export interface RxHttpRequest extends RxHttpRequestBase { url: string; method: string; json?: boolean; } export interface RxHttpRequestConfigured extends RxHttpRequest { json: boolean; actions: RxHttpGlobalActionType[]; } export interface RxHttpResponse { response: Response; data: any; } export declare type RxHttpAction = { type: string; args: RxHttpArgs; } | RxHttpGlobalErrorAction | RxHttpErrorAction | RxHttpRequestAction; export declare type RxHttpGet = (path: string, actionTypes: RxHttpActionTypes, query?: RxHttpQueryParams | null, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type RxHttpPost = (path: string, actionTypes: RxHttpActionTypes, body?: T, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type RxHttpPut = (path: string, actionTypes: RxHttpActionTypes, body?: T, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type RxHttpPatch = (path: string, actionTypes: RxHttpActionTypes, body?: T, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type RxHttpDelete = (path: string, actionTypes: RxHttpActionTypes, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type RxHttpHead = (path: string, actionTypes: RxHttpActionTypes, config?: RxHttpRequestConfig) => RxHttpRequestAction; export declare type Fetch = (input: RequestInfo, init?: RequestInit) => Promise; export interface RxHttpDependencies { fetch: Fetch; }