swaf/src/CacheProvider.ts

15 lines
356 B
TypeScript
Raw Normal View History

2020-07-19 11:57:47 +02:00
export default interface CacheProvider {
get<T extends string | undefined>(key: string, defaultValue?: T): Promise<T>;
2020-07-19 11:57:47 +02:00
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>;
}