IDBDatabase
import { IDBDatabase } from "https://raw.githubusercontent.com/aaronhuggins/indexeddb/main/ponyfill.ts";
This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database.
interface IDBDatabase extends EventTarget {
readonly name: string;
readonly objectStoreNames: DOMStringList;
onabort: ((this: IDBDatabase, ev: Event) => any) | null;
onclose: ((this: IDBDatabase, ev: Event) => any) | null;
onerror: ((this: IDBDatabase, ev: Event) => any) | null;
onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;
prototype: IDBDatabase;
readonly version: number;
addEventListener<K extends keyof IDBDatabaseEventMap>(
type: K,
listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;close(): void;
deleteObjectStore(name: string): void;
new (): IDBDatabase;
removeEventListener<K extends keyof IDBDatabaseEventMap>(
type: K,
listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
}type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;const IDBDatabase;
§Properties
§
readonly objectStoreNames: DOMStringList
[src]Returns a list of the names of object stores in the database.
§
onabort: ((this: IDBDatabase, ev: Event) => any) | null
[src]§
onclose: ((this: IDBDatabase, ev: Event) => any) | null
[src]§
onerror: ((this: IDBDatabase, ev: Event) => any) | null
[src]§
onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null
[src]§
prototype: IDBDatabase
[src]§Methods
§
addEventListener<K extends keyof IDBDatabaseEventMap>(
[src]type: K,
listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
Creates a new object store with the given name and options and returns a new IDBObjectStore.
Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
§
deleteObjectStore(name: string): void
[src]Deletes the object store with the given name.
Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
§
new (): IDBDatabase
[src]§
removeEventListener<K extends keyof IDBDatabaseEventMap>(
[src]type: K,
listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void