UNPKG

@busymango/fetch-driver

Version:

fetch with middlewares for the browser

19 lines (18 loc) 567 B
/** * @author mango * @description fetch core */ import DriveContext from "./context"; import type { DriveFunc, DriveMiddleware, DriveOptions, DriveReport } from "./model"; type FetchDriverParams = DriveMiddleware[] | { use?: DriveMiddleware[]; report?: DriveReport; }; export default class FetchDriver { private report?; private middleware; constructor(opts?: FetchDriverParams); request: <T>({ api, use, data, timeout, receiver, parse, ...init }: DriveOptions<T>) => Promise<Required<DriveContext<T>>>; drive: DriveFunc; } export {};