IPersistentCache<T>
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / IPersistentCache
Interface: IPersistentCache<T>
Section titled “Interface: IPersistentCache<T>”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3038
Persistent cache interface
Extends
Section titled “Extends”IProofCache<T>
Type Parameters
Section titled “Type Parameters”T = SingleProof
Methods
Section titled “Methods”get(
key):Promise<CacheLookupResult<T>>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976
Get an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<CacheLookupResult<T>>
Inherited from
Section titled “Inherited from”set(
key,value,ttlMs?):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980
Set an entry in the cache
Parameters
Section titled “Parameters”string | CacheKey
T
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984
Delete an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”has(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988
Check if an entry exists
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”clear()
Section titled “clear()”clear():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992
Clear all entries
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”getStats()
Section titled “getStats()”getStats():
ProofCacheStats
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996
Get cache statistics
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”keys()
Section titled “keys()”keys(
pattern?):Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000
Get all keys matching a pattern
Parameters
Section titled “Parameters”pattern?
Section titled “pattern?”string
Returns
Section titled “Returns”Promise<string[]>
Inherited from
Section titled “Inherited from”addEventListener()
Section titled “addEventListener()”addEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004
Add an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”removeEventListener()
Section titled “removeEventListener()”removeEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008
Remove an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”IProofCache.removeEventListener
initialize()
Section titled “initialize()”initialize():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3042
Initialize the persistent storage
Returns
Section titled “Returns”Promise<void>
close()
Section titled “close()”close():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3046
Close the persistent storage
Returns
Section titled “Returns”Promise<void>
isAvailable()
Section titled “isAvailable()”isAvailable():
boolean
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3050
Check if storage is available
Returns
Section titled “Returns”boolean
getStorageInfo()
Section titled “getStorageInfo()”getStorageInfo():
Promise<{used:number;available:number;quota:number; }>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3054
Get storage usage information
Returns
Section titled “Returns”Promise<{ used: number; available: number; quota: number; }>
compact()
Section titled “compact()”compact():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3062
Compact the storage (remove expired, defragment)
Returns
Section titled “Returns”Promise<void>