UNPKG

pretur.sync

Version:

Front-end back-end communication infrastructure

18 lines (17 loc) 409 B
import { Method } from 'pretur.fetch'; export interface FetchOptions { url: string; method?: Method; body?: any; json?: boolean; } export interface FetchStatus { ok: boolean; code: number; text: string; } export interface FetchResponse<TBody> { body: TBody; status: FetchStatus; } export declare function fetch<TBody>(options: FetchOptions): Promise<FetchResponse<TBody>>;