Class IndexedDBPersistedLRUCache<K, V>
Constructors
constructor
- new IndexedDBPersistedLRUCache<K, V>(dbPromise, maxCount): IndexedDBPersistedLRUCache<K, V>
Parameters
dbPromise: Promise<DB<K, V>>
maxCount: number
Properties
Private
Readonly
#dbPromise
#dbPromise: Promise<DB<K, V>> Private
#maxCount
#maxCount: number
Methods
[asyncIterator]
- [asyncIterator](): AsyncGenerator<IDBPCursorWithValueIteratorValue<Schema<K, V>, ArrayLike<"store">, "store", "access" | "expiry", IDBTransactionMode>, void, undefined>
Returns AsyncGenerator<IDBPCursorWithValueIteratorValue<Schema<K, V>, ArrayLike<"store">, "store", "access" | "expiry", IDBTransactionMode>, void, undefined>
__set
- __set(store, key, value, options): Promise<void>
Parameters
store: Store<K, V, "readwrite">
key: K
value: V
Returns Promise<void>
clear
- clear(): Promise<void>
Returns Promise<void>
count
- count(): Promise<number>
Returns Promise<number>
db
- db(): Promise<DB<K, V>>
Returns Promise<DB<K, V>>
delete
- delete(key): Promise<void>
Returns Promise<void>
evict
- evict(count): Promise<number>
Returns Promise<number>
find
- find(key): Promise<undefined | Value<K, V>>
Returns Promise<undefined | Value<K, V>>
gc
- gc(): Promise<number>
Returns Promise<number>
get
- get(key): Promise<Value<K, V>>
Returns Promise<Value<K, V>>
getCursor
- getCursor<M>(mode, key): Promise<null | CursorWithValue<K, V, M>>
Type Parameters
M extends IDBTransactionMode
Returns Promise<null | CursorWithValue<K, V, M>>
has
- has(key): Promise<boolean>
Returns Promise<boolean>
index
- index(mode, field): Promise<IDBPIndex<Schema<K, V>, ArrayLike<"store">, "store", "access" | "expiry", IDBTransactionMode>>
Parameters
mode: IDBTransactionMode
field: "access" | "expiry"
Returns Promise<IDBPIndex<Schema<K, V>, ArrayLike<"store">, "store", "access" | "expiry", IDBTransactionMode>>
resize
- resize(maxCount): Promise<void>
Returns Promise<void>
set
- set(key, value, options): Promise<void>
Returns Promise<void>
store
- store<M>(mode): Promise<Store<K, V, M>>
Type Parameters
M extends IDBTransactionMode
Returns Promise<Store<K, V, M>>
toArray
- toArray(): Promise<Value<K, V>[]>
Returns Promise<Value<K, V>[]>
update
- update(key, update): Promise<void>
Parameters
key: K
update: ((value) => Fields<V>)
Returns Promise<void>
upsert
- upsert(key, init, update): Promise<void>
Returns Promise<void>