mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
updated interceptor use type definition to remove interceptor options parameter from use method for response interceptors (#5237)
* updated interceptor use type definition to remove interceptor options parameter from use method for response interceptors * incorporated type changes to index.d.cts --------- Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Vendored
+5
-1
@@ -476,8 +476,12 @@ export interface AxiosInterceptorOptions {
|
||||
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
||||
}
|
||||
|
||||
type AxiosRequestInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number;
|
||||
|
||||
type AxiosResponseInterceptorUse<T> = (onFulfilled?: ((value: T) => T | Promise<T>) | null, onRejected?: ((error: any) => any) | null) => number;
|
||||
|
||||
export interface AxiosInterceptorManager<V> {
|
||||
use(onFulfilled?: ((value: V) => V | Promise<V>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number;
|
||||
use: V extends AxiosResponse ? AxiosResponseInterceptorUse<V> : AxiosRequestInterceptorUse<V>;
|
||||
eject(id: number): void;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user