@seayoo-web/request 0.4.0 → 0.4.1
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/dist/inc/option.d.ts +2 -2
- package/dist/inc/type.d.ts +2 -1
- package/package.json +1 -1
package/dist/inc/option.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IBaseRequestOptions } from "./type";
|
|
1
|
+
import type { IBaseRequestOptions, IBaseRequestBody } from "./type";
|
|
2
2
|
import type { RequestGlobalConfig } from "./config";
|
|
3
3
|
type FixedRequestOptions = Omit<Required<IBaseRequestOptions>, "params" | "body"> & {
|
|
4
4
|
params: Record<string, string>;
|
|
5
5
|
body: ReturnType<typeof convertBody>;
|
|
6
6
|
};
|
|
7
7
|
export declare function convertOptions(url: string, config: RequestGlobalConfig, options?: IBaseRequestOptions): FixedRequestOptions;
|
|
8
|
-
declare function convertBody(body: IBaseRequestOptions["body"]):
|
|
8
|
+
declare function convertBody(body: IBaseRequestOptions["body"]): IBaseRequestBody | undefined;
|
|
9
9
|
export {};
|
package/dist/inc/type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RequestGlobalConfig } from "./config";
|
|
2
|
+
export type IBaseRequestBody = Blob | ArrayBuffer | FormData | URLSearchParams | string;
|
|
2
3
|
/** 通用网络请求工具的基本配置 */
|
|
3
4
|
export interface IBaseRequestOptions {
|
|
4
5
|
/** 网络请求方法,默认 GET */
|
|
@@ -8,7 +9,7 @@ export interface IBaseRequestOptions {
|
|
|
8
9
|
/** url 参数 */
|
|
9
10
|
params?: Record<string, unknown>;
|
|
10
11
|
/** 发送的 body 内容,method 为 GET / HEAD / DELETE 时无效 */
|
|
11
|
-
body?:
|
|
12
|
+
body?: IBaseRequestBody | Record<string | number, unknown> | unknown[];
|
|
12
13
|
/**
|
|
13
14
|
* 是否携带用户认证信息(cookie, basic http auth 等),默认 "same-orgin",
|
|
14
15
|
*
|