feat: update new options
This commit is contained in:
12
src/query.ts
12
src/query.ts
@@ -1,4 +1,4 @@
|
||||
import { adapter, isTextForContentType, Method } from './adapter.ts';
|
||||
import { adapter, isTextForContentType, Method, AdapterOpts } from './adapter.ts';
|
||||
import type { QueryWs } from './ws.ts';
|
||||
/**
|
||||
* 请求前处理函数
|
||||
@@ -14,17 +14,9 @@ export type Fn = (opts: {
|
||||
}) => Promise<Record<string, any> | false>;
|
||||
|
||||
export type QueryOpts = {
|
||||
url?: string;
|
||||
headers?: Record<string, string>;
|
||||
body?: Record<string, any> | FormData; // body 可以是对象、字符串或 FormData
|
||||
timeout?: number;
|
||||
method?: Method;
|
||||
isBlob?: boolean; // 是否返回 Blob 对象
|
||||
isPostFile?: boolean; // 是否为文件上传
|
||||
|
||||
adapter?: typeof adapter;
|
||||
[key: string]: any;
|
||||
};
|
||||
} & AdapterOpts;
|
||||
export type Data = {
|
||||
path?: string;
|
||||
key?: string;
|
||||
|
||||
Reference in New Issue
Block a user