@artmate/chat
Version:
**开箱即用的AI组件库(基于 Vue3 + ElementPlus)**
19 lines (18 loc) • 655 B
TypeScript
export interface ArtFetchMiddlewares {
onRequest?: (...ags: Parameters<typeof fetch>) => Promise<Parameters<typeof fetch>>;
onResponse?: (response: Response) => Promise<Response>;
}
export interface ArtFetchOptions extends RequestInit {
/**
* @description A typeof fetch function
* @default globalThis.fetch
*/
fetch?: typeof fetch;
/**
* @description Middleware for request and response
*/
middlewares?: ArtFetchMiddlewares;
}
export type ArtFetchType = (baseURL: Parameters<typeof fetch>[0], options?: ArtFetchOptions) => Promise<Response>;
declare const ArtFetch: ArtFetchType;
export default ArtFetch;