import superagent from 'superagent'; import { HTTPMethod } from '../../shared/types/http'; import { NetworkAdapterFetchOptions } from '../modules/network-adapter'; export interface ResponseError extends Error { status: number; response: superagent.Response; } /** * Check if Error is thrown from superagent due to reponse with 4xx, 5xx status. * For 4xx, 5xx status, superagent throws Error object with status and response. */ export declare function isResponseError(value: unknown): value is ResponseError; export declare function composeFetchOption(method: Extract, headers: Record | undefined, body: string | object | undefined): NetworkAdapterFetchOptions; /** * Get media type part from Content-Type header value, and returns it in lowercase. * * Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type#syntax */ export declare function getContentType(contentTypeHeader: string): string; /** * Parse form string into key-value pair object. */ export declare function parseFormData(value: string): Record; export declare function isRedirectCode(code: number): boolean;