import { b as XiorRequestConfig, I as ICacheLike, a as XiorResponse, g as XiorError, e as XiorPlugin } from '../types-BvXZzfqR.mjs'; type XiorErrorCacheOptions = { /** * check if we need enable cache, default only `GET` method or`isGet: true` enable cache @error-cache-plugin */ enableCache?: boolean | ((config?: XiorRequestConfig) => boolean); defaultCache?: ICacheLike<{ loading?: boolean; res?: XiorResponse; cacheTime?: number; }>; /** if `useCacheFirst: true` and have cache, will return the cache response first, then run fetching in the background @error-cache-plugin */ useCacheFirst?: boolean; /** for logging purpose @error-cache-plugin */ onCacheRequest?: (config?: XiorRequestConfig) => void; /** max cache numbers in LRU, default is 100 */ cacheItems?: number; /** Process the config before generating the key based on data/params. The config is a new object, not a request reference. */ normalizeParams?: (config: XiorRequestConfig) => XiorRequestConfig; }; /** @ts-ignore */ declare module 'xior' { interface XiorRequestConfig extends Omit { } interface XiorResponse { fromCache?: boolean; error?: XiorError; cacheTime?: number; } } declare function xiorErrorCachePlugin(options?: XiorErrorCacheOptions): XiorPlugin; export { type XiorErrorCacheOptions, xiorErrorCachePlugin as default };