import type { MaybePromise } from '../types.js'; /** * Keyv compatible Store. See https://github.com/lukechilds/keyv */ export type Store = { readonly ttlSupport: boolean; /** * Get the current value of a key. Is undefined when the value is currently not set. */ readonly get: (key: K) => MaybePromise; /** * Set a key to a specific value. * @param key key to be set * @param value value to set to the key * @param ttl time to live of the object in milliseconds from now (when supported by the implementation) */ readonly set: (key: K, value: V, ttl?: number) => MaybePromise; /** * Delete a key from the store. Returns true when the key existed, false if the element does not exist. */ readonly delete: (key: K) => MaybePromise; /** * Remove all entries */ readonly clear: () => MaybePromise; }; export type ExtendedStore = Store & { /** * Return all currently set keys */ readonly keys: () => MaybePromise; };