UNPKG

592 BTypeScriptView Raw
1import { Middleware } from './middlewares/middleware';
2import { HttpRequest } from './request';
3export declare type Path = string;
4export declare type FetchAdapter = (url: string, request: RequestInit) => Promise<Response>;
5export declare type HttpClient = (path: Path, options?: Partial<HttpRequest>) => Promise<Response>;
6export declare function withDefaults(request: Partial<HttpRequest>): Partial<HttpRequest>;
7export interface ClientConfiguration {
8 middleware?: Middleware<any>;
9 fetch?: FetchAdapter;
10}
11export declare function createHttp(opts?: ClientConfiguration): HttpClient;