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

IDBRequest

import { IDBRequest } from "https://raw.githubusercontent.com/aaronhuggins/indexeddb/main/ponyfill.ts";

The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance.

interface IDBRequest <T = any> extends EventTarget {
readonly error: DOMException | null;
onerror: ((this: IDBRequest<T>, ev: Event) => any) | null;
onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null;
prototype: IDBRequest;
readonly readyState: IDBRequestReadyState;
readonly result: T;
readonly source: IDBObjectStore | IDBIndex | IDBCursor;
readonly transaction: IDBTransaction | null;
addEventListener<K extends keyof IDBRequestEventMap>(
type: K,
listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
new (): IDBRequest;
removeEventListener<K extends keyof IDBRequestEventMap>(
type: K,
listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
}
const IDBRequest;

§Type Parameters

§
T = any
[src]

§Extends

§
EventTarget
[src]

§Properties

§
readonly error: DOMException | null
[src]

When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws a "InvalidStateError" DOMException if the request is still pending.

§
onerror: ((this: IDBRequest<T>, ev: Event) => any) | null
[src]
§
onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null
[src]
§
readonly readyState: IDBRequestReadyState
[src]

Returns "pending" until a request is complete, then returns "done".

§
readonly result: T
[src]

When a request is completed, returns the result, or undefined if the request failed. Throws a "InvalidStateError" DOMException if the request is still pending.

§

Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request.

§
readonly transaction: IDBTransaction | null
[src]

Returns the IDBTransaction the request was made within. If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.

§Methods

§
addEventListener<K extends keyof IDBRequestEventMap>(
type: K,
listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
removeEventListener<K extends keyof IDBRequestEventMap>(
type: K,
listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void
[src]