@vtex/api
Version:
VTEX I/O API client
8 lines (7 loc) • 326 B
TypeScript
import { FetchResult } from './typings';
export interface CacheLayer<K, V> {
get(key: K, fetcher?: () => Promise<FetchResult<V>>): Promise<V | void> | V | void;
has(key: K): Promise<boolean> | boolean;
set(key: K, value: V, maxAge?: number | void): Promise<boolean> | boolean;
getStats?(name?: string): any;
}