Class: AppKitCacheStorage
Memory-first AppKit CacheStorage backed by @dbx-tools/cache.
Implements
Section titled “Implements”CacheStorage
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppKitCacheStorage(
cache,persistent):AppKitCacheStorage
Parameters
Section titled “Parameters”Cacheable
persistent
Section titled “persistent”CacheStorage | undefined
Returns
Section titled “Returns”AppKitCacheStorage
Methods
Section titled “Methods”cleanupExpired()
Section titled “cleanupExpired()”cleanupExpired():
Promise<number>
Forward AppKit’s runtime-only persistent cleanup hook when available.
Returns
Section titled “Returns”Promise<number>
clear()
Section titled “clear()”clear():
Promise<void>
Clear the storage
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”CacheStorage.clear
close()
Section titled “close()”close():
Promise<void>
Close the storage
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”CacheStorage.close
delete()
Section titled “delete()”delete(
key):Promise<void>
Delete a value from the storage
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”CacheStorage.delete
flush()
Section titled “flush()”flush():
Promise<void>
Drain tracked write-behind persistence without closing the storage.
Returns
Section titled “Returns”Promise<void>
get<
T>(key):Promise<CacheEntry<T> |null>
Get a cached value from the storage
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CacheEntry<T> | null>
Implementation of
Section titled “Implementation of”CacheStorage.get
has(
key):Promise<boolean>
Check if a value exists in the storage
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”CacheStorage.has
healthCheck()
Section titled “healthCheck()”healthCheck():
Promise<boolean>
Check if the storage is healthy
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”CacheStorage.healthCheck
isPersistent()
Section titled “isPersistent()”isPersistent():
boolean
Check if the storage is persistent
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”CacheStorage.isPersistent
set<
T>(key,entry):Promise<void>
Set a value in the storage
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
CacheEntry<T>
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”CacheStorage.set
size()
Section titled “size()”size():
Promise<number>
Get the size of the storage
Returns
Section titled “Returns”Promise<number>
Implementation of
Section titled “Implementation of”CacheStorage.size