import { BodyTypes } from "./BodyTypes"; import { ResponseWrapper } from "../ResponseTransform"; export interface RequestParams { url: URL; headers: Headers; body: BodyTypes | null; } type ResponseData = ReturnType; export type beforeRequestPlugin = (input: RequestParams) => RequestParams; export type afterRequestPlugin = (input: ResponseData) => ResponseData; /** 可以配置事件的 Plugin */ export type PluginObject = { beforeRequest?: beforeRequestPlugin; afterRequest?: afterRequestPlugin; }; export type createPlugin = (input?: T) => beforeRequestPlugin; export type createPluginObject = (input?: T) => PluginObject;