forked from svrcekmichal/redux-axios-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
50 lines (31 loc) · 1.31 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import axios, {AxiosInstance, AxiosError, AxiosResponse} from 'axios';
export interface suffixTypes {
errorSuffix: string;
successSuffix: string;
}
export interface axiosMiddleware extends suffixTypes {
default: (client: AxiosInstance, customMiddleWareOptions: any, customClientOptions: any) => any;
getActionTypes: (action: any) => any;
multiClientMiddleware: (client: any, customMiddleWareOptions: any) => any;
(client: AxiosInstance, customMiddleWareOptions?: any, customClientOptions?: any): any;
}
export interface IClientDefinition {
client: AxiosInstance;
options?: any;
}
export interface IClientsList {
[name: string]: IClientDefinition;
default: IClientDefinition;
}
declare const axiosMiddleware: axiosMiddleware;
export function multiClientMiddleware(clients?: IClientsList, customMiddlewareOptions?: any): any;
export const returnRejectedPromiseOnError: boolean;
export const defaultClientName: string;
export const isAxiosRequest: boolean;
export const getRequestConfig: AxiosResponse;
export const getClientName: AxiosInstance;
export const getRequestOptions: any;
export function onSuccess({action, next, response}?: any, options?: any): any;
export function onError({action, next, response}?: any, options?: any): any;
export function onComplete(): any;
export default axiosMiddleware;