swaf/src/CacheProvider.ts
2020-07-19 12:01:22 +02:00

14 lines
342 B
TypeScript

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>;
}