import type { NuxtApp, AsyncDataOptions, AsyncData, NuxtError } from 'nuxt/app'; import type { MaybeRefOrGetter } from 'vue'; import type { DefaultAsyncDataErrorValue, DefaultAsyncDataValue } from '#app/defaults'; import type { PickFrom } from '#app/composables/asyncData'; import { type MaxAge } from '../helpers/maxAge.js'; type KeysOf = Array; type ValueOrMethod = ((v: ResT) => T) | T; type CachedAsyncDataOptions = KeysOf, DefaultT = DefaultAsyncDataValue> = Omit, 'getCachedData'> & { /** * The client-side max age in seconds. * * If undefined or 0, nothing will be cached. To cache permanently, define 'permanent' or -1. * * If a positive integer value is provided, the composable will return * cached data (either from payload or from previous client-side * fetches) for the given duration. */ clientMaxAge: MaxAge; /** * The server-side max age in seconds. * * Can be a number or a method that receives the result of your useAsyncData * handler and should return a number. * * If undefined or 0, nothing will be cached. To cache permanently, define 'permanent' or -1. */ serverMaxAge: ValueOrMethod; /** * The server-side cache tags to use. * * Can be an array of strings or a method that receives the result of your useAsyncData * handler and should return an array of strings. */ serverCacheTags?: ValueOrMethod; }; export declare function useCachedAsyncData = KeysOf, DefaultT = undefined>(key: MaybeRefOrGetter, handler: (ctx?: NuxtApp) => Promise, options: CachedAsyncDataOptions): AsyncData | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError) | DefaultAsyncDataErrorValue>; export declare function useCachedAsyncData = KeysOf, DefaultT = DataT>(key: MaybeRefOrGetter, handler: (ctx?: NuxtApp) => Promise, options: CachedAsyncDataOptions): AsyncData | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError) | DefaultAsyncDataErrorValue>; export {};