swaf/src/CacheProvider.ts

14 lines
342 B
TypeScript
Raw Normal View History

2020-07-19 11:57:47 +02:00
export default interface CacheProvider {
get(key: string, defaultValue?: string): Promise<string | null>;
has(key: string): Promise<boolean>;
forget(key: string): Promise<void>;
/**
* @param key
* @param value
* @param ttl in ms
*/
remember(key: string, value: string, ttl: number): Promise<void>;
}