Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/lib.dom.ts>IDBTransaction

💧EventEmitter's typesafe replacement
Go to Latest
interface IDBTransaction
implements EventTarget
import { type IDBTransaction } from "https://deno.land/x/evt@v2.4.20/lib/types/lib.dom.ts";

Properties

readonly
db: IDBDatabase

Returns the transaction's connection.

readonly
error: DOMException

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

readonly
mode: IDBTransactionMode

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

readonly
objectStoreNames: DOMStringList

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
oncomplete: ((this: IDBTransaction, ev: Event) => any) | null
onerror: ((this: IDBTransaction, ev: Event) => any) | null

Methods

abort(): void

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

objectStore(name: string): IDBObjectStore

Returns an IDBObjectStore in the transaction's scope.

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
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