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

IDBTransaction

import { IDBTransaction } from "https://raw.githubusercontent.com/aaronhuggins/indexeddb/main/ponyfill.ts";
interface IDBTransaction extends EventTarget {
readonly db: IDBDatabase;
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;
prototype: IDBTransaction;
abort(): void;
addEventListener<K extends keyof IDBTransactionEventMap>(
type: K,
listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
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,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
}
const IDBTransaction;

§Extends

§
EventTarget
[src]

§Properties

§
readonly db: IDBDatabase
[src]

Returns the transaction's connection.

§
readonly error: DOMException | null
[src]

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

§
readonly mode: IDBTransactionMode
[src]

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,
listener: EventListenerOrEventListenerObject,
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,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void
[src]