UNPKG

@idxdb/promised

Version:

@idxdb/promised wraps the IndexedDB API. It allows you to easily store and retrieve data in an indexed db database using async/await syntax, making it easier to integrate with your existing codebase.

27 lines (26 loc) 1.62 kB
import { IndexInterface, KeyCursorInterface, ObjectStoreInterface, TransactionInterface, ValueCursorInterface } from '../component/interface/components.interface.js'; export declare class ObjectStore implements ObjectStoreInterface { private readonly ctx; constructor(ctx: { objectStore: IDBObjectStore; }); add<V, K extends IDBValidKey>(value: V, key?: K): Promise<K>; clear(): Promise<void>; count<K extends IDBValidKey>(query?: IDBKeyRange | K): Promise<number>; createIndex(indexName: string, keyPath: string | string[], options?: IDBIndexParameters): IndexInterface; delete<K extends IDBValidKey>(query: IDBKeyRange | K): Promise<void>; deleteIndex(name: string): void; get<R, K extends IDBValidKey>(key: K): Promise<R>; getAll<R, K extends IDBValidKey>(query?: IDBKeyRange | K, count?: number): Promise<R[]>; getAllKeys<K extends IDBValidKey>(query?: IDBKeyRange | K, count?: number): Promise<K[]>; getKey<K extends IDBValidKey>(key: IDBKeyRange | K): Promise<K>; index(name: string): IndexInterface; openCursor<PK extends IDBValidKey, K extends IDBValidKey, R>(query?: IDBKeyRange | K, direction?: IDBCursorDirection): ValueCursorInterface<PK, K, R>; openKeyCursor<PK extends IDBValidKey, K extends IDBValidKey>(query?: IDBKeyRange | K, direction?: IDBCursorDirection): KeyCursorInterface<PK, K>; put<V, K extends IDBValidKey>(value: V, key?: K): Promise<void>; get indexNames(): string[]; get autoIncrement(): boolean; get keyPath(): string | string[]; get name(): string; get transaction(): TransactionInterface; }