From ecfab9a7cf655737af46dd02ba013c5600b81e82 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Tue, 9 Feb 2021 01:08:59 +0330 Subject: [PATCH] fix(types): update interceptors type (#476) --- types/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 3b4f830..fa6793f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -17,11 +17,11 @@ interface NuxtAxiosInstance extends AxiosStatic { setHeader(name: string, value?: string | false, scopes?: string | string[]): void setToken(token: string | false, type?: string, scopes?: string | string[]): void - onRequest(callback: (config: AxiosRequestConfig) => void): void - onResponse(callback: (response: AxiosResponse) => void): void - onError(callback: (error: AxiosError) => void): void - onRequestError(callback: (error: AxiosError) => void): void - onResponseError(callback: (error: AxiosError) => void): void + onRequest(callback: (config: AxiosRequestConfig) => void | AxiosRequestConfig | Promise): void + onResponse(callback: (response: AxiosResponse) => void | AxiosResponse | Promise> ): void + onError(callback: (error: AxiosError) => any): void + onRequestError(callback: (error: AxiosError) => any): void + onResponseError(callback: (error: AxiosError) => any): void create(options?: AxiosRequestConfig): NuxtAxiosInstance }