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

IDBTransaction

interface IDBTransaction extends EventTarget {
readonly db: IDBDatabase;
readonly durability: IDBTransactionDurability;
readonly error: DOMException | null;
readonly mode: IDBTransactionMode;
readonly objectStoreNames: DOMStringList;
onabort: ((this: IDBTransaction, ev: Event) => any) | null;
oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;
onerror: ((this: IDBTransaction, ev: Event) => any) | null;
abort(): void;
addEventListener<K extends keyof IDBTransactionEventMap>(
type: K,
listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void;
commit(): void;
objectStore(name: string): IDBObjectStore;
removeEventListener<K extends keyof IDBTransactionEventMap>(
type: K,
listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void;
}
var IDBTransaction: {
prototype: IDBTransaction;
new (): IDBTransaction;
}
;

§Extends

§Properties

§
readonly db: IDBDatabase
[src]

Returns the transaction's connection.

§
readonly durability: IDBTransactionDurability
[src]
§
readonly error: DOMException | null
[src]

If the transaction was aborted, returns the error (a DOMException) providing the reason.

§

Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction.

§
readonly objectStoreNames: DOMStringList
[src]

Returns a list of the names of object stores in the transaction's scope. For an upgrade transaction this is all object stores in the database.

§
onabort: ((this: IDBTransaction, ev: Event) => any) | null
[src]
§
oncomplete: ((this: IDBTransaction, ev: Event) => any) | null
[src]
§
onerror: ((this: IDBTransaction, ev: Event) => any) | null
[src]

§Methods

§
abort(): void
[src]

Aborts the transaction. All pending requests will fail with a "AbortError" DOMException and all changes made to the database will be reverted.

§
addEventListener<K extends keyof IDBTransactionEventMap>(
type: K,
listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
commit(): void
[src]
§
objectStore(name: string): IDBObjectStore
[src]

Returns an IDBObjectStore in the transaction's scope.

§
removeEventListener<K extends keyof IDBTransactionEventMap>(
type: K,
listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
[src]