feat: update new options

This commit is contained in:
2025-06-07 19:07:28 +08:00
parent 14dec5f5c5
commit ca154ba883
3 changed files with 16 additions and 20 deletions

View File

@@ -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;