KeyValueCache.ts 424 B

12345678910111213
  1. export interface KeyValueCache<V = string> {
  2. get(key: string): Promise<V | undefined>;
  3. set(key: string, value: V, options?: KeyValueCacheSetOptions): Promise<void>;
  4. delete(key: string): Promise<boolean | void>;
  5. }
  6. export interface KeyValueCacheSetOptions {
  7. /**
  8. * Specified in **seconds**, the time-to-live (TTL) value limits the lifespan
  9. * of the data being stored in the cache.
  10. */
  11. ttl?: number | null;
  12. }