nuxt-multi-cache
Version:
SSR route, component and data cache for Nuxt.js
11 lines (10 loc) • 373 B
TypeScript
import type { H3Event } from 'h3';
type AddToCacheMethod<T> = (data: T, tags?: string[], maxAge?: number) => Promise<void>;
type CallbackContext<T> = {
addToCache: AddToCacheMethod<T>;
value?: T;
cacheTags: string[];
expires?: number;
};
export declare function useDataCache<T>(key: string, providedEvent?: H3Event): Promise<CallbackContext<T>>;
export {};