import type { FetchContext, ResponseType, FetchResponse } from 'ofetch'; import type { BubbleCacheability } from '../types/index.js'; type OnResponseInterceptor = (ctx: FetchContext & { response: FetchResponse; }) => void; type OnRequestInterceptor = (ctx: FetchContext) => void; type UseCacheAwareFetchInterceptor = { onResponse?: OnResponseInterceptor; onRequest?: OnRequestInterceptor; }; /** * Returns onResponse and onRequest fetch interceptors that will bubble * cacheability from the response to the current request event. * * The onResponse interceptor will merge CDN headers from CDN cached API routes * to the current request and merge them. * * If the route cache is enabled, the onResponse interceptor will also bubble * maxAge and cacheTags from route-cached API routes to the current request. * * The onRequest interceptor adds a special request header to indicate that * this is an internal request originating from Nuxt during SSR. * * @param bubbleCacheability Which cacheability to bubble. true => everything, * route => only route cache, cdn => only CDN headers. Defaults to true. */ export declare function useCacheAwareFetchInterceptor(bubbleCacheability?: BubbleCacheability): UseCacheAwareFetchInterceptor; export {};