Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

IDBPCursor

interface IDBPCursor <DBTypes extends DBSchema | unknown = unknown, TxStores extends ArrayLike<StoreNames<DBTypes>> = ArrayLike<StoreNames<DBTypes>>, StoreName extends StoreNames<DBTypes> = StoreNames<DBTypes>, IndexName extends IndexNames<DBTypes, StoreName> | unknown = unknown, Mode extends IDBTransactionMode = "readonly"> extends IDBPCursorExtends {
delete: Mode extends "readonly" ? undefined : () => Promise<void>;
readonly key: CursorKey<DBTypes, StoreName, IndexName>;
readonly primaryKey: StoreKey<DBTypes, StoreName>;
readonly source: CursorSource<DBTypes, TxStores, StoreName, IndexName, Mode>;
update: Mode extends "readonly" ? undefined : (value: StoreValue<DBTypes, StoreName>) => Promise<StoreKey<DBTypes, StoreName>>;
[[Symbol.asyncIterator]](): AsyncIterableIterator<IDBPCursorIteratorValue<DBTypes, TxStores, StoreName, IndexName, Mode>>;
advance<T>(this: T, count: number): Promise<T | null>;
continue<T>(this: T, key?: CursorKey<DBTypes, StoreName, IndexName>): Promise<T | null>;
continuePrimaryKey<T>(
this: T,
key: CursorKey<DBTypes, StoreName, IndexName>,
primaryKey: StoreKey<DBTypes, StoreName>,
): Promise<T | null>;
}

§Type Parameters

§
DBTypes extends DBSchema | unknown = unknown
[src]
§
TxStores extends ArrayLike<StoreNames<DBTypes>> = ArrayLike<StoreNames<DBTypes>>
[src]
§
StoreName extends StoreNames<DBTypes> = StoreNames<DBTypes>
[src]
§
IndexName extends IndexNames<DBTypes, StoreName> | unknown = unknown
[src]
§
Mode extends IDBTransactionMode = "readonly"
[src]

§Extends

§
IDBPCursorExtends
[src]

§Properties

§
delete: Mode extends "readonly" ? undefined : () => Promise<void>
[src]

Delete the current record.

§
readonly key: CursorKey<DBTypes, StoreName, IndexName>
[src]

The key of the current index or object store item.

§
readonly primaryKey: StoreKey<DBTypes, StoreName>
[src]

The key of the current object store item.

§
readonly source: CursorSource<DBTypes, TxStores, StoreName, IndexName, Mode>
[src]

Returns the IDBObjectStore or IDBIndex the cursor was opened from.

§
update: Mode extends "readonly" ? undefined : (value: StoreValue<DBTypes, StoreName>) => Promise<StoreKey<DBTypes, StoreName>>
[src]

Updated the current record.

§Methods

§
[[Symbol.asyncIterator]](): AsyncIterableIterator<IDBPCursorIteratorValue<DBTypes, TxStores, StoreName, IndexName, Mode>>
[src]

Iterate over the cursor.

§
advance<T>(this: T, count: number): Promise<T | null>
[src]

Advances the cursor a given number of records.

Resolves to null if no matching records remain.

§
continue<T>(this: T, key?: CursorKey<DBTypes, StoreName, IndexName>): Promise<T | null>
[src]

Advance the cursor by one record (unless 'key' is provided).

Resolves to null if no matching records remain.

@param key

Advance to the index or object store with a key equal to or greater than this value.

§
continuePrimaryKey<T>(
this: T,
key: CursorKey<DBTypes, StoreName, IndexName>,
primaryKey: StoreKey<DBTypes, StoreName>,
): Promise<T | null>
[src]

Advance the cursor by given keys.

The operation is 'and' – both keys must be satisfied.

Resolves to null if no matching records remain.

@param key

Advance to the index or object store with a key equal to or greater than this value.

@param primaryKey

and where the object store has a key equal to or greater than this value.