IQCache
@quik/core / IQCache
Interface: IQCache
Defined in: features/QCache.ts:6
Interface describing the contract for a cache feature.
Methods
clear()
clear():
Promise<void>
Defined in: features/QCache.ts:40
Remove all entries from the cache.
Returns
Promise<void>
delete()
delete(
key):Promise<void>
Defined in: features/QCache.ts:28
Remove a value by key.
Parameters
key
string
Cache key.
Returns
Promise<void>
get()
get<
T>(key):Promise<T>
Defined in: features/QCache.ts:12
Retrieve a value by key.
Type Parameters
T
T = unknown
Parameters
key
string
Cache key.
Returns
Promise<T>
has()
has(
key):Promise<boolean>
Defined in: features/QCache.ts:35
Check whether a key exists and has not expired.
Parameters
key
string
Cache key.
Returns
Promise<boolean>
set()
set<
T>(key,value,ttlMs?):Promise<void>
Defined in: features/QCache.ts:21
Store a value by key with an optional TTL.
Type Parameters
T
T = unknown
Parameters
key
string
Cache key.
value
T
Value to store.
ttlMs?
number
Optional time-to-live in milliseconds.
Returns
Promise<void>