@varlet/axle 0.2.4-alpha.1701343552475 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AxiosInterceptorOptions, AxiosResponse } from 'axios';
|
|
2
2
|
import type { ResponseInterceptor } from '../instance';
|
|
3
3
|
export interface ResponseBlobInterceptorOptions {
|
|
4
|
-
|
|
4
|
+
onResponse?: (response: AxiosResponse<any, any>) => any;
|
|
5
5
|
axiosInterceptorOptions?: AxiosInterceptorOptions;
|
|
6
6
|
}
|
|
7
7
|
export declare function responseBlobInterceptor(options?: ResponseBlobInterceptorOptions): ResponseInterceptor;
|
|
@@ -3,7 +3,7 @@ export function responseBlobInterceptor(options = {}) {
|
|
|
3
3
|
onFulfilled(response) {
|
|
4
4
|
var _a, _b;
|
|
5
5
|
if (response.request.responseType === 'blob') {
|
|
6
|
-
return (_b = (_a = options.
|
|
6
|
+
return (_b = (_a = options.onResponse) === null || _a === void 0 ? void 0 : _a.call(options, response)) !== null && _b !== void 0 ? _b : response;
|
|
7
7
|
}
|
|
8
8
|
return response;
|
|
9
9
|
},
|