Skip to content

Commit ecfab9a

Browse files
authored
fix(types): update interceptors type (#476)
1 parent 62f17ca commit ecfab9a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

types/index.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ interface NuxtAxiosInstance extends AxiosStatic {
1717
setHeader(name: string, value?: string | false, scopes?: string | string[]): void
1818
setToken(token: string | false, type?: string, scopes?: string | string[]): void
1919

20-
onRequest(callback: (config: AxiosRequestConfig) => void): void
21-
onResponse<T = any>(callback: (response: AxiosResponse<T>) => void): void
22-
onError(callback: (error: AxiosError) => void): void
23-
onRequestError(callback: (error: AxiosError) => void): void
24-
onResponseError(callback: (error: AxiosError) => void): void
20+
onRequest(callback: (config: AxiosRequestConfig) => void | AxiosRequestConfig | Promise<AxiosRequestConfig>): void
21+
onResponse<T = any>(callback: (response: AxiosResponse<T>) => void | AxiosResponse<T> | Promise<AxiosResponse<T>> ): void
22+
onError(callback: (error: AxiosError) => any): void
23+
onRequestError(callback: (error: AxiosError) => any): void
24+
onResponseError(callback: (error: AxiosError) => any): void
2525

2626
create(options?: AxiosRequestConfig): NuxtAxiosInstance
2727
}

0 commit comments

Comments
 (0)