export interface DatabaseInterface { close(): void; createObjectStore(name: string, options?: IDBObjectStoreParameters): ObjectStoreInterface; deleteObjectStore(name: string): void; transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): TransactionInterface; objectStoreNames: string[]; } export interface ObjectStoreInterface { add(value: V, key?: K): Promise; clear(): Promise; count(query?: IDBKeyRange | K): Promise; createIndex(indexName: string, keyPath: string | string[], options?: IDBIndexParameters): IndexInterface; delete(query: IDBKeyRange | K): Promise; deleteIndex(name: string): void; get(key: K): Promise; getAll(query?: IDBKeyRange | K, count?: number): Promise; getAllKeys(query?: IDBKeyRange | K, count?: number): Promise; getKey(key: IDBKeyRange | K): Promise; index(name: string): IndexInterface; openCursor(query?: IDBKeyRange | K, direction?: IDBCursorDirection): ValueCursorInterface; openKeyCursor(query?: IDBKeyRange | K, direction?: IDBCursorDirection): KeyCursorInterface; put(value: V, key?: K): Promise; indexNames: string[]; autoIncrement: boolean; keyPath: string | string[]; name: string; transaction: TransactionInterface; } export interface IndexInterface { keyPath: string | string[]; multiEntry: boolean; name: string; objectStore: ObjectStoreInterface; unique: boolean; count(query?: IDBKeyRange | K): Promise; get(key: K): Promise; getAll(query?: IDBKeyRange | K, count?: number): Promise; getAllKeys(query?: IDBKeyRange | KType, count?: number): Promise; getKey(key: IDBKeyRange | K): Promise; openCursor(query?: IDBKeyRange | K, direction?: IDBCursorDirection): ValueCursorInterface; openKeyCursor(query?: IDBKeyRange | K, direction?: IDBCursorDirection): KeyCursorInterface; } export interface ValueCursorInterface extends KeyCursorInterface { value: R | undefined; delete(): Promise; update(value: R): Promise; } export interface KeyCursorInterface { primaryKey: PK | undefined; key: K | undefined; direction: IDBCursorDirection; source: ObjectStoreInterface | IndexInterface; request: IDBRequest; end(): Promise; continue(key?: K): void; advance(count: number): void; continuePrimaryKey(key: K, primaryKey: PK): void; } export interface TransactionInterface { abort(): Promise; commit(): Promise; objectStore(name: string): ObjectStoreInterface; objectStoreNames: string[]; db: DatabaseInterface; durability: IDBTransactionDurability; error: DOMException; mode: IDBTransactionMode; }