import { DB_Object, DBIndex, IndexKeys } from '@nu-art/ts-common'; export type ReduceFunction = (accumulator: ReturnType, arrayItem: ItemType, index?: number, array?: ItemType[]) => ReturnType; export type DBConfig = { name: string; version?: number; autoIncrement?: boolean; uniqueKeys: Ks[]; indices?: DBIndex[]; upgradeProcessor?: (db: IDBDatabase) => void; }; export type IndexDb_Query = { query?: string | number | string[] | number[]; indexKey?: string; limit?: number; }; export declare class IndexedDB { private db; private config; private static dbs; static getOrCreate(config: DBConfig): IndexedDB; constructor(config: DBConfig); exists(): Promise; open(): Promise; readonly store: (write?: boolean, store?: IDBObjectStore) => Promise; private getCursor; private cursorHandler; insert(value: T, _store?: IDBObjectStore): Promise; insertAll(values: T[], _store?: IDBObjectStore): Promise; upsert(value: T, _store?: IDBObjectStore): Promise; upsertAll(values: T[], _store?: IDBObjectStore): Promise; get(key: IndexKeys): Promise; query(query: IndexDb_Query): Promise; queryFilter(filter: (item: T) => boolean, query?: IndexDb_Query): Promise; WIP_queryMapNew(mapper: (item: T) => Type, filter?: (item: T) => boolean, query?: IndexDb_Query): Promise; WIP_queryMap(mapper: (item: T) => Type, filter?: (item: T) => boolean, query?: IndexDb_Query): Promise; queryFind(filter: (item: T) => boolean): Promise; queryReduce(reducer: ReduceFunction, initialValue: ReturnType, filter?: (item: T) => boolean, query?: IndexDb_Query): Promise; clearDB(): Promise; deleteDB(): Promise; deleteAll(keys: (IndexKeys | T)[]): Promise; delete(key: (IndexKeys | T)): Promise; }