UNPKG

@cachex/indexeddb

Version:

IndexedDB implementation of CacheX

28 lines (25 loc) 785 B
import { AsyncCacheAbsract } from '@cachex/core'; declare class IndexedDBCache extends AsyncCacheAbsract { private db?; private status; private table; constructor(db?: string); get<T>(key: string, defaultValue?: T): Promise<T | undefined>; set<T>(key: string, value: T, ttl?: number): Promise<boolean>; delete(key: string): Promise<boolean>; clear(): Promise<boolean>; has(key: string): Promise<boolean>; /** * get the object from the database * @param key the key to get * @returns the object if in the database */ private internalGet; /** * helper to run a requeset against the database * * @returns the transation ObjectStore */ private getTransation; } export { IndexedDBCache as default };