UNPKG

@itokun99/http

Version:

Fetch util for better fetching api

9 lines (7 loc) 668 B
import { Method, Option, ParamType, RequestApiOptions } from './types'; export declare const getContentType: (t?: string) => "application/x-www-form-urlencoded" | "application/json" | undefined; export declare const getBody: (m: Method, t: RequestApiOptions["contentType"], b: unknown) => unknown; export declare function searchParamsToObject(searchParams: string): Record<string, string>; export declare function objectToSearchParams(obj?: ParamType): string; export declare function createEndpoint(endpoint: string, path?: string, params?: ParamType): string; export declare function resolveRequestOptions(options?: Option): Promise<RequestApiOptions | undefined>;