UNPKG

@artmate/chat

Version:

借鉴字节开源react库AntX,通过vue实现的版本

19 lines (18 loc) 655 B
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;