@mxlabs/okxnotify
Version:
OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle
20 lines (19 loc) • 616 B
TypeScript
/**
* 优化fetch请求
*/
export interface IFetchOptions {
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD';
headers?: Record<string, string | number>;
params?: Record<string, any>;
timeout?: number;
}
export declare const handleRequestError: (response: Response) => Promise<unknown>;
/**
* 基于 fetch 的 http 请求,匹配 GET 和 POST 请求,
* - GET 请求通过 params 字段传递参数
* - POST 请求通过 params 字段传递参数
* @param url
* @param options
* @returns
*/
export declare const httpRequest: <T = any>(url: string, options: IFetchOptions) => Promise<T>;