@snail-js/api
Version:
Http Request with Decorators Api, build on axios
11 lines (10 loc) • 406 B
TypeScript
import { CacheGetData, CacheStorageAdapter } from "../typings";
export default class LocalStorageCache implements CacheStorageAdapter {
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[]>;
}