UNPKG

mappersmith

Version:

It is a lightweight rest client for node.js and the browser

35 lines (29 loc) 1.3 kB
export type Method = 'get' | 'head' | 'post' | 'put' | 'patch' | 'delete' export interface HTTPRequestParams { // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any } export interface HTTPGatewayConfiguration { configure?: ((requestParams: HTTPRequestParams) => HTTPRequestParams) | null onRequestWillStart?: ((requestParams: HTTPRequestParams) => void) | null onRequestSocketAssigned?: ((requestParams: HTTPRequestParams) => void) | null onSocketLookup?: ((requestParams: HTTPRequestParams) => void) | null onSocketConnect?: ((requestParams: HTTPRequestParams) => void) | null onSocketSecureConnect?: ((requestParams: HTTPRequestParams) => void) | null onResponseReadable?: ((requestParams: HTTPRequestParams) => void) | null onResponseEnd?: ((requestParams: HTTPRequestParams) => void) | null useSocketConnectionTimeout?: boolean } interface XHRGatewayConfiguration { withCredentials?: boolean configure?: ((xmlHttpRequest: XMLHttpRequest) => void) | null } type FetchGatewayConfiguration = Partial<RequestInit> export interface GatewayConfiguration { Fetch: FetchGatewayConfiguration HTTP: HTTPGatewayConfiguration Mock?: Record<string, unknown> XHR: XHRGatewayConfiguration enableHTTP408OnTimeouts: boolean emulateHTTP: boolean }