UNPKG

idb-prime-ts

Version:

A lightweight and efficient and flexible JS/TS library for managing IndexedDB operations in web browsers. Provides utility functions for CRUD operations, object store management, and indexed queries.

41 lines (40 loc) 1.38 kB
export type primeIDBtype = { dbName: string; dbVersion: number; objectStoreName: string; indexes?: false | { indexName: string; unique: boolean; }[]; delObjectStore?: boolean; }; export declare const dbVersionIDB: (dbName: string, dbVersion?: number) => Promise<number>; type addToIDBT = primeIDBtype & { obj: any; }; export declare function addToIDB(args: addToIDBT): Promise<unknown>; type getByIndexIDBT = primeIDBtype & { index: any; condition?: any; }; export declare function getByIndexIDB(args: getByIndexIDBT): Promise<unknown>; type getByIdIDBT = primeIDBtype & { id: number; }; export declare function getByIdIDB(args: getByIdIDBT): Promise<unknown>; export declare function getAllObjStoreIDB(args: primeIDBtype): Promise<unknown>; export declare function delByIndexIDB(args: getByIndexIDBT): Promise<unknown>; export declare function delByIdIDB(args: getByIdIDBT): Promise<unknown>; export declare const delObjectStore: (args: primeIDBtype) => Promise<void>; type updateByIdIDBT = primeIDBtype & { id: number; updateItem: any; }; export declare function updateByIdIDB(args: updateByIdIDBT): Promise<unknown>; type updateByIndexIDBT = primeIDBtype & { index: any; condition?: any; updateItem: any; }; export declare function updateByIndexIDB(args: updateByIndexIDBT): Promise<unknown>; export {};