API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classIndexedDbDatabase
Database implementation backed by the browser's IndexedDB API. Each object store is created with a `keyPath` of `"name"`, so records are stored as `{ name, data }` objects. By default the database is initialised with stores for every built-in asset type (font, image, sound, etc.); pass a custom `storeNames` list to restrict or extend the set. Schema migrations are handled in two modes: - **Default** — the constructor-supplied `storeNames` list is diff'd against the existing stores and objects stores added/deleted accordingly. - **Explicit** — a `migrations` map keyed by target version runs the corresponding callback for each version between `oldVersion` and `newVersion`, allowing precise schema evolution.
import { IndexedDbDatabase } from '@codexo/exojs' Database implementation backed by the browser's IndexedDB API.
Each object store is created with a `keyPath` of `"name"`, so records are stored as `{ name, data }` objects. By default the database is initialised with stores for every built-in asset type (font, image, sound, etc.); pass a custom `storeNames` list to restrict or extend the set.
Schema migrations are handled in two modes: - **Default** — the constructor-supplied `storeNames` list is diff'd against the existing stores and objects stores added/deleted accordingly. - **Explicit** — a `migrations` map keyed by target version runs the corresponding callback for each version between `oldVersion` and `newVersion`, allowing precise schema evolution.
new(name: string, version: number, storeNames: readonly string[], migrations?: Record<number, object>): IndexedDbDatabase clearStorage(type: string): Promise<boolean> connect(): Promise<boolean> delete(type: string, name: string): Promise<boolean> deleteStorage(): Promise<boolean> destroy(): void disconnect(): Promise<boolean> getObjectStore(type: string, transactionMode: IDBTransactionMode): Promise<IDBObjectStore> load(type: string, name: string): Promise<T | null> save(type: string, name: string, data: unknown): Promise<void> name: string version: number connected: boolean