Skip to content

IndexedDBCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / IndexedDBCache

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

IndexedDB-based persistent cache for browsers

T = SingleProof

new IndexedDBCache<T>(config?): IndexedDBCache<T>

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

Partial<PersistentCacheConfig>

IndexedDBCache<T>

initialize(): Promise<void>

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

Initialize the IndexedDB storage

Promise<void>

IPersistentCache.initialize


close(): Promise<void>

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

Close the IndexedDB connection

Promise<void>

IPersistentCache.close


isAvailable(): boolean

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

Check if IndexedDB is available

boolean

IPersistentCache.isAvailable


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

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

Get storage usage information

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

IPersistentCache.getStorageInfo


compact(): Promise<void>

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

Compact the storage (remove expired entries)

Promise<void>

IPersistentCache.compact


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

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

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>

IPersistentCache.get


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

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

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>

IPersistentCache.set


delete(key): Promise<boolean>

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

Delete an entry from the cache

string | CacheKey

Promise<boolean>

IPersistentCache.delete


has(key): Promise<boolean>

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

Check if an entry exists

string | CacheKey

Promise<boolean>

IPersistentCache.has


clear(): Promise<void>

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

Clear all entries

Promise<void>

IPersistentCache.clear


getStats(): ProofCacheStats

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

Get cache statistics

ProofCacheStats

IPersistentCache.getStats


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

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

Get all keys matching a pattern

string

Promise<string[]>

IPersistentCache.keys


addEventListener(listener): void

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

Add an event listener

CacheEventListener

void

IPersistentCache.addEventListener


removeEventListener(listener): void

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

Remove an event listener

CacheEventListener

void

IPersistentCache.removeEventListener