IndexedDBCache<T>
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / IndexedDBCache
Class: IndexedDBCache<T>
Section titled “Class: IndexedDBCache<T>”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3294
IndexedDB-based persistent cache for browsers
Type Parameters
Section titled “Type Parameters”T = SingleProof
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IndexedDBCache<
T>(config?):IndexedDBCache<T>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3303
Parameters
Section titled “Parameters”config?
Section titled “config?”Partial<PersistentCacheConfig>
Returns
Section titled “Returns”IndexedDBCache<T>
Methods
Section titled “Methods”initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3307
Initialize the IndexedDB storage
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”close()
Section titled “close()”close():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3311
Close the IndexedDB connection
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”isAvailable()
Section titled “isAvailable()”isAvailable():
boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3315
Check if IndexedDB is available
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”getStorageInfo()
Section titled “getStorageInfo()”getStorageInfo():
Promise<{used:number;available:number;quota:number; }>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3319
Get storage usage information
Returns
Section titled “Returns”Promise<{ used: number; available: number; quota: number; }>
Implementation of
Section titled “Implementation of”IPersistentCache.getStorageInfo
compact()
Section titled “compact()”compact():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3327
Compact the storage (remove expired entries)
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”get(
key):Promise<CacheLookupResult<T>>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3331
Get an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<CacheLookupResult<T>>
Implementation of
Section titled “Implementation of”set(
key,value,ttlMs?):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3335
Set an entry in the cache
Parameters
Section titled “Parameters”string | CacheKey
T
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3339
Delete an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”has(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3343
Check if an entry exists
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”clear()
Section titled “clear()”clear():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3347
Clear all entries
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”getStats()
Section titled “getStats()”getStats():
ProofCacheStats
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3351
Get cache statistics
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”keys()
Section titled “keys()”keys(
pattern?):Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3355
Get all keys matching a pattern
Parameters
Section titled “Parameters”pattern?
Section titled “pattern?”string
Returns
Section titled “Returns”Promise<string[]>
Implementation of
Section titled “Implementation of”addEventListener()
Section titled “addEventListener()”addEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3356
Add an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IPersistentCache.addEventListener
removeEventListener()
Section titled “removeEventListener()”removeEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3357
Remove an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void