UNPKG

dnsimple

Version:

A Node.JS client for the DNSimple API.

21 lines (20 loc) 779 B
import type { RateLimitHeaders } from "../types"; /** * A function that makes an HTTP request. It's responsible for throwing {@link TimeoutError} and aborting the request on {@param params.timeout}. * It should return the response status, full body as a string, and rate limit headers. It should not throw on any status, even if 4xx or 5xx. * It can decide to implement retries as appropriate. The default fetcher currently does not implement any retry strategy. */ export type Fetcher = (params: { method: string; url: string; headers: { [name: string]: string; }; body?: string; timeout: number; }) => Promise<{ status: number; body: string; rateLimit: RateLimitHeaders; }>; export declare function getRuntimeFetcher(): Fetcher;