UNPKG

@technobuddha/library

Version:
20 lines (19 loc) 787 B
export declare class TimeoutError extends Error { constructor(); } export declare type Options = RequestInit & { /** The number of milliseconds before timeout */ timeout?: number; }; /** * Fetch a remote resource * * @see https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch * @see https://developer.mozilla.org/en-US/docs/Web/API/Request/Request * @param url - The url of a resource that you wish to fetch * @param __namedParameters see {@link Options} * * @throws TimeoutError when timeout occurs */ export declare function fetcher(url: string, { body, cache, credentials, keepalive, method, mode, headers, integrity, redirect, referrer, referrerPolicy, signal, timeout, window, }?: Options): Promise<Response>; export default fetcher;