UNPKG

@snail-js/api

Version:

Http Request with Decorators Api, build on axios

12 lines (11 loc) 422 B
import { CacheGetData, CacheStorageAdapter } from "../typings"; export default class MemoryCache implements CacheStorageAdapter { private CacheMap; ttl: number; constructor(ttl: number); get<T = any>(key: string): Promise<CacheGetData<T>>; set<T = any>(key: string, value: T): Promise<boolean>; delete(key: string): Promise<boolean>; clear(): Promise<boolean>; keys(): Promise<string[]>; }