Skip to content

Commit

Permalink
Update types to include newly added Interceptor Options
Browse files Browse the repository at this point in the history
Updates Typescript definition file to include types for the interceptor options that were added in axios#2702 so that Typescript users are able to safely consume this feature.
  • Loading branch information
Jeff Berry committed Oct 16, 2021
1 parent 1025d12 commit 6d342c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.d.ts
Expand Up @@ -161,8 +161,17 @@ export interface CancelTokenSource {
cancel: Canceler;
}

export interface AxiosInterceptorOptions {
runWhen?: (config: HttpRequestConfig) => boolean | undefined;
synchronous?: boolean;
}

export interface AxiosInterceptorManager<V> {
use<T = V>(onFulfilled?: (value: V) => T | Promise<T>, onRejected?: (error: any) => any): number;
use<T = V>(
onFulfilled?: (value: V) => T | Promise<T>,
onRejected?: (error: any) => any,
options?: AxiosInterceptorOptions
): number;
eject(id: number): void;
}

Expand Down

0 comments on commit 6d342c5

Please sign in to comment.