@seayoo-web/request 4.0.4 → 4.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/request",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "request tools for seayoo web",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -7,6 +7,7 @@ export type URLPlus = string | {
7
7
  export type BufferRequestOptions = RequestOptions & {
8
8
  asBuffer: true;
9
9
  };
10
+ export type INetRequestHandler = Pick<NetRequestHandler, keyof NetRequestHandler>;
10
11
  /** 工具函数主类 */
11
12
  export declare class NetRequestHandler {
12
13
  private agent;
package/types/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { NetRequestHandler } from "./inc/main";
1
+ import { INetRequestHandler } from "./inc/main";
2
2
  import { xhrUpload } from "./inc/request.xhr";
3
3
  import type { RequestGlobalConfig } from "./inc/type";
4
4
  export { jsonp, jsonx } from "./inc/jsonp";
5
5
  export { getResponseRulesDescription } from "./inc/rule";
6
6
  export { RequestInternalError } from "./inc/type";
7
- export type { NetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
7
+ export type { NetRequestHandler, INetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
8
8
  export type { RequestOptions, RequestGlobalConfig, ResponseRule, ResponseResult, RequestLog, RequestMethod, RequestQueryParams, } from "./inc/type";
9
9
  /**
10
10
  * 基于 xhr 模块的上传工具,支持上传进度
@@ -15,7 +15,7 @@ export type NetRequestFactory = typeof NetRequest;
15
15
  /**
16
16
  * 创建新的实例空间,配置和缓存跟全局默认实例是隔离的,仅支持在浏览器环境使用
17
17
  */
18
- export declare function NetRequest(config?: RequestGlobalConfig): NetRequestHandler;
18
+ export declare function NetRequest(config?: RequestGlobalConfig): INetRequestHandler;
19
19
  /**
20
20
  * 设置全局默认的 Request Config
21
21
  */
package/types/node.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { NetRequestHandler } from "./inc/main";
1
+ import { INetRequestHandler } from "./inc/main";
2
2
  import type { RequestGlobalConfig } from "./inc/type";
3
3
  export { getResponseRulesDescription } from "./inc/rule";
4
4
  export { RequestInternalError } from "./inc/type";
5
- export type { NetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
5
+ export type { NetRequestHandler, INetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
6
6
  export type { RequestOptions, RequestGlobalConfig, ResponseRule, ResponseResult, RequestLog, RequestMethod, RequestQueryParams, } from "./inc/type";
7
7
  /**
8
8
  * 创建新的实例空间,配置和缓存跟全局默认实例是隔离的
9
9
  */
10
- export declare function NetRequest(config?: RequestGlobalConfig): NetRequestHandler;
10
+ export declare function NetRequest(config?: RequestGlobalConfig): INetRequestHandler;
11
11
  /**
12
12
  * 设置全局默认的 Request Config
13
13
  */
package/types/wx.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { NetRequestHandler } from "./inc/main";
1
+ import { INetRequestHandler } from "./inc/main";
2
2
  import type { RequestGlobalConfig } from "./inc/type";
3
3
  export { getResponseRulesDescription } from "./inc/rule";
4
4
  export { RequestInternalError } from "./inc/type";
5
- export type { NetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
5
+ export type { NetRequestHandler, INetRequestHandler, URLPlus, BufferRequestOptions } from "./inc/main";
6
6
  export type { RequestOptions, RequestGlobalConfig, ResponseRule, ResponseResult, RequestLog, RequestMethod, RequestQueryParams, } from "./inc/type";
7
7
  /**
8
8
  * 创建新的实例空间,配置和缓存跟全局默认实例是隔离的
9
9
  */
10
- export declare function NetRequest(config?: RequestGlobalConfig): NetRequestHandler;
10
+ export declare function NetRequest(config?: RequestGlobalConfig): INetRequestHandler;
11
11
  /**
12
12
  * 设置全局默认的 Request Config
13
13
  */