From 6a814bc01266b52f665617edc7efe23ad215f59a Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Sun, 7 Jan 2024 20:22:07 -0800 Subject: [PATCH] [axios]: Add definition for interceptor `.clear()` --- definitions/npm/axios_v1.x.x/flow_v0.201.x-/axios_v1.x.x.js | 2 ++ .../npm/axios_v1.x.x/flow_v0.201.x-/test_axios_v1.x.x.js | 2 ++ .../npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/axios_v1.x.x.js | 2 ++ .../npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/test_axios_v1.x.x.js | 2 ++ 4 files changed, 8 insertions(+) diff --git a/definitions/npm/axios_v1.x.x/flow_v0.201.x-/axios_v1.x.x.js b/definitions/npm/axios_v1.x.x/flow_v0.201.x-/axios_v1.x.x.js index 7983fbe81c..bde0bdd60f 100644 --- a/definitions/npm/axios_v1.x.x/flow_v0.201.x-/axios_v1.x.x.js +++ b/definitions/npm/axios_v1.x.x/flow_v0.201.x-/axios_v1.x.x.js @@ -120,6 +120,7 @@ declare module 'axios' { onRejected: ?(error: mixed) => mixed ): AxiosInterceptorIdent, eject(ident: AxiosInterceptorIdent): void, + clear(): void, |}; declare type AxiosResponseInterceptor = {| @@ -128,6 +129,7 @@ declare module 'axios' { onRejected: ?(error: mixed) => mixed ): AxiosInterceptorIdent, eject(ident: AxiosInterceptorIdent): void, + clear(): void, |}; declare type AxiosPromise = Promise>; diff --git a/definitions/npm/axios_v1.x.x/flow_v0.201.x-/test_axios_v1.x.x.js b/definitions/npm/axios_v1.x.x/flow_v0.201.x-/test_axios_v1.x.x.js index eb5b4ac0b9..47fb4d5405 100644 --- a/definitions/npm/axios_v1.x.x/flow_v0.201.x-/test_axios_v1.x.x.js +++ b/definitions/npm/axios_v1.x.x/flow_v0.201.x-/test_axios_v1.x.x.js @@ -308,6 +308,7 @@ describe('Interceptors', () => { ); axios.interceptors.request.eject(requestInterceptorId); + axios.interceptors.request.clear(); axios.interceptors.request.use( (config: $AxiosXHRConfig) => Promise.resolve(config), @@ -327,6 +328,7 @@ describe('Interceptors', () => { ); axios.interceptors.response.eject(responseInterceptorId); + axios.interceptors.response.clear(); axios.interceptors.response.use( (response: $AxiosXHR) => Promise.resolve(response), diff --git a/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/axios_v1.x.x.js b/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/axios_v1.x.x.js index 401475d199..174d017265 100644 --- a/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/axios_v1.x.x.js +++ b/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/axios_v1.x.x.js @@ -120,6 +120,7 @@ declare module 'axios' { onRejected: ?(error: mixed) => mixed ): AxiosInterceptorIdent, eject(ident: AxiosInterceptorIdent): void, + clear(): void, |}; declare type AxiosResponseInterceptor = {| @@ -128,6 +129,7 @@ declare module 'axios' { onRejected: ?(error: mixed) => mixed ): AxiosInterceptorIdent, eject(ident: AxiosInterceptorIdent): void, + clear(): void, |}; declare type AxiosPromise = Promise>; diff --git a/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/test_axios_v1.x.x.js b/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/test_axios_v1.x.x.js index 690be53159..99a1e75d52 100644 --- a/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/test_axios_v1.x.x.js +++ b/definitions/npm/axios_v1.x.x/flow_v0.83.x-v0.200.x/test_axios_v1.x.x.js @@ -308,6 +308,7 @@ describe('Interceptors', () => { ); axios.interceptors.request.eject(requestInterceptorId); + axios.interceptors.request.clear(); axios.interceptors.request.use( (config: $AxiosXHRConfig) => Promise.resolve(config), @@ -327,6 +328,7 @@ describe('Interceptors', () => { ); axios.interceptors.response.eject(responseInterceptorId); + axios.interceptors.response.clear(); axios.interceptors.response.use( (response: $AxiosXHR) => Promise.resolve(response),