UNPKG

rollun-ts-datastore

Version:

rollun-datastore written in TS

16 lines (15 loc) 647 B
import { HttpClientInterface } from '../datastores/interfaces'; export default abstract class AbstractClient<T = {}> implements HttpClientInterface<T> { protected url: string; protected headers: Headers; abstract get(): Promise<Response>; abstract post(): Promise<Response>; abstract put(): Promise<Response>; abstract delete(): Promise<Response>; abstract head(): Promise<Response>; protected generateFullHeaders(headers?: { [key: string]: string; }): Headers; protected generateRequestBodyString(body: T | string): string; protected catchHTTPResponseError(res: Response): Promise<Response>; }