UNPKG

@alwatr/fetch

Version:

Enhanced fetch API with cache strategy, retry pattern, timeout, helper methods and enhanced types.

28 lines 1.04 kB
import type { FetchOptions } from './type.js'; export declare const logger_: import("@alwatr/logger").AlwatrLogger; export declare const cacheSupported: boolean; /** * Process fetch options and set defaults, etc. * * @param options Fetch options. * * @returns Required fetch options. */ export declare function processOptions_(options: FetchOptions): Required<FetchOptions>; /** * Handle Cache Strategy over `handleRemoveDuplicate_`. */ export declare function handleCacheStrategy_(options: Required<FetchOptions>): Promise<Response>; /** * Handle Remove Duplicates over `_handleRetryPattern`. */ export declare function handleRemoveDuplicate_(options: Required<FetchOptions>): Promise<Response>; /** * Handle retry pattern over `handleTimeout_`. */ export declare function handleRetryPattern_(options: Required<FetchOptions>): Promise<Response>; /** * It's a wrapper around the browser's `fetch` with timeout. */ export declare function handleTimeout_(options: FetchOptions): Promise<Response>; //# sourceMappingURL=core.d.ts.map