Skip to content

Commit

Permalink
fix: fixed type definition of axiosRetry return value from void
Browse files Browse the repository at this point in the history
  • Loading branch information
yutak23 committed Aug 2, 2023
1 parent a502fcd commit 0cc4bc0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface IAxiosRetry {
(
axios: axios.AxiosStatic | axios.AxiosInstance,
axiosRetryConfig?: IAxiosRetry.IAxiosRetryConfig
): void;
): IAxiosRetry.IAxiosRetryReturn;

isNetworkError(error: Error): boolean;
isRetryableError(error: Error): boolean;
Expand Down Expand Up @@ -57,11 +57,27 @@ declare namespace IAxiosRetry {
*/
onRetry?: (retryCount: number, error: axios.AxiosError, requestConfig: axios.AxiosRequestConfig) => void
}

export interface IAxiosRetryReturn {
/**
* The interceptorId for the request interceptor
*
* @type {number}
*/
requestInterceptorId: number;
/**
* The interceptorId for the response interceptor
*
* @type {number}
*/
responseInterceptorId: number;
}
}

declare const axiosRetry: IAxiosRetry;

export type IAxiosRetryConfig = IAxiosRetry.IAxiosRetryConfig;
export type IAxiosRetryReturn = IAxiosRetry.IAxiosRetryReturn;

export default axiosRetry;

Expand Down

0 comments on commit 0cc4bc0

Please sign in to comment.