Class ObjectStore<T, PK, TNoKey>
Type Parameters
PK extends IDBValidKey
TNoKey
Constructors
constructor
- new ObjectStore<T, PK, TNoKey>(objectStore): ObjectStore<T, PK, TNoKey>
Type Parameters
T
PK extends IDBValidKey
TNoKey
Parameters
objectStore: IDBObjectStore
Methods
add
- add(value, key?): Promise<PK>
Returns Promise<PK>
clear
- clear(): Promise<undefined>
Returns Promise<undefined>
count
- count(query?): Promise<number>
Parameters
Optional
query: PK | IDBKeyRange
Returns Promise<number>
delete
- delete(query): Promise<undefined>
Returns Promise<undefined>
deleteIndex
- deleteIndex<IT>(indexDef): void
Returns void
get
- get(query): Promise<undefined | T>
Returns Promise<undefined | T>
getAll
- getAll(query?, count?): Promise<T[]>
Parameters
Optional
query: PK | IDBKeyRange
Optional
count: number
Returns Promise<T[]>
getAllPrimaryKeys
- getAllPrimaryKeys(query?, count?): Promise<PK[]>
Parameters
Optional
query: PK | IDBKeyRange
Optional
count: number
Returns Promise<PK[]>
getPrimaryKey
- getPrimaryKey(query): Promise<undefined | PK>
Returns Promise<undefined | PK>
put
- put(value, key?): Promise<PK>
Returns Promise<PK>
requireGet
- requireGet(key): Promise<T>
Returns Promise<T>
tryDeleteIndex
- tryDeleteIndex(name): boolean
Returns boolean
T is the type of the object, PK is the type of the object's primary key.