@varlet/axle 0.2.4-alpha.1701343124078 → 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.
package/es/instance.d.ts CHANGED
@@ -6,7 +6,7 @@ export type FetchRunner = <T = any, R = AxiosResponse<T>>(url: string, params?:
6
6
  export type ModifyRunner = <T = any, R = AxiosResponse<T>>(url: string, params?: any, config?: AxleRequestConfig) => Promise<R>;
7
7
  export type FetchMethod = 'get' | 'delete' | 'options' | 'head';
8
8
  export type ModifyMethod = 'post' | 'put' | 'patch';
9
- export type RunnerMethod = keyof Omit<AxleInstance, 'axios' | 'getHeaders' | 'setHeader' | 'removeHeader'>;
9
+ export type RunnerMethod = keyof Omit<AxleInstance, 'axios' | 'getHeaders' | 'setHeader' | 'removeHeader' | 'useRequestInterceptor' | 'useResponseInterceptor'>;
10
10
  export interface Interceptor<V> {
11
11
  onFulfilled?: ((value: V) => any) | null;
12
12
  onRejected?: ((error: any) => any) | null;
@@ -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
- data?: (response: AxiosResponse<any, any>) => any;
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.data) === null || _a === void 0 ? void 0 : _a.call(options, response)) !== null && _b !== void 0 ? _b : response;
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
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/axle",
3
- "version": "0.2.4-alpha.1701343124078",
3
+ "version": "0.2.4",
4
4
  "description": "Progressive request tool based on axios",
5
5
  "type": "module",
6
6
  "main": "es/index.js",