UNPKG

fexios

Version:

Fetch based HTTP client with similar API to axios for browser and Node.js

18 lines (17 loc) 723 B
import { FexiosConfigs, IFexiosResponse as IFexiosResponse } from './types'; /** * Fexios response wrapper class */ export declare class FexiosResponse<T = any> implements IFexiosResponse<T> { rawResponse: Response; data: T; ok: boolean; status: number; statusText: string; headers: Headers; constructor(rawResponse: Response, data: T, overrides?: Partial<Omit<FexiosResponse<T>, 'rawResponse' | 'data'>>); } /** * Resolve response body based on content type and expected type */ export declare function resolveResponseBody<T = any>(rawResponse: Response, expectType?: FexiosConfigs['responseType'], onProgress?: (progress: number, buffer?: Uint8Array) => void): Promise<FexiosResponse<T>>;