Skip to content

IPersistentCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / IPersistentCache

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3038

Persistent cache interface

T = SingleProof

get(key): Promise<CacheLookupResult<T>>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>

IProofCache.get


set(key, value, ttlMs?): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>

IProofCache.set


delete(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984

Delete an entry from the cache

string | CacheKey

Promise<boolean>

IProofCache.delete


has(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988

Check if an entry exists

string | CacheKey

Promise<boolean>

IProofCache.has


clear(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992

Clear all entries

Promise<void>

IProofCache.clear


getStats(): ProofCacheStats

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996

Get cache statistics

ProofCacheStats

IProofCache.getStats


keys(pattern?): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000

Get all keys matching a pattern

string

Promise<string[]>

IProofCache.keys


addEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004

Add an event listener

CacheEventListener

void

IProofCache.addEventListener


removeEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008

Remove an event listener

CacheEventListener

void

IProofCache.removeEventListener


initialize(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3042

Initialize the persistent storage

Promise<void>


close(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3046

Close the persistent storage

Promise<void>


isAvailable(): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3050

Check if storage is available

boolean


getStorageInfo(): Promise<{ used: number; available: number; quota: number; }>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3054

Get storage usage information

Promise<{ used: number; available: number; quota: number; }>


compact(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3062

Compact the storage (remove expired, defragment)

Promise<void>