API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classIndexedDbStore

@codexo/exojs / assets / stable

CacheStore that persists acquired asset representations in IndexedDB. ```ts const app = new Application({ loader: { cache: new IndexedDbStore('my-game') } }); ``` ## One generic store Every record of every asset type lives in a single `records` object store, keyed by the serialized CacheRecordKey. The logical namespace is part of that key, which is data - so an asset type installed at runtime by an extension, or written by an application this engine has never seen, caches immediately. Nothing about a new type requires a schema version bump, an object store, or any engine-side registration. ## Values Anything the structured-clone algorithm accepts round-trips: strings, `ArrayBuffer`s, typed arrays, `Blob`s, plain objects. Values are stored directly, never JSON-serialized. ## Schema changes discard the cache A database written by an earlier physical schema is emptied on first open. Cached representations are reconstructible by definition, so preserving them across a schema change would cost more than re-fetching them. ## Failures Every failure rejects with an AssetCacheError naming the operation and carrying the originating `DOMException` as `cause`, so a `QuotaExceededError` is distinguishable from a transaction or schema failure without parsing message text. A write resolves only once its transaction has committed. Nothing is swallowed: whether a failure degrades a load is the CachePolicy's decision.

1
props
5
methods
0
events
Import
import { IndexedDbStore } from '@codexo/exojs'

CacheStore that persists acquired asset representations in IndexedDB.

```ts const app = new Application({ loader: { cache: new IndexedDbStore('my-game') } }); ```

## One generic store

Every record of every asset type lives in a single `records` object store, keyed by the serialized CacheRecordKey. The logical namespace is part of that key, which is data - so an asset type installed at runtime by an extension, or written by an application this engine has never seen, caches immediately. Nothing about a new type requires a schema version bump, an object store, or any engine-side registration.

## Values

Anything the structured-clone algorithm accepts round-trips: strings, `ArrayBuffer`s, typed arrays, `Blob`s, plain objects. Values are stored directly, never JSON-serialized.

## Schema changes discard the cache

A database written by an earlier physical schema is emptied on first open. Cached representations are reconstructible by definition, so preserving them across a schema change would cost more than re-fetching them.

## Failures

Every failure rejects with an AssetCacheError naming the operation and carrying the originating `DOMException` as `cause`, so a `QuotaExceededError` is distinguishable from a transaction or schema failure without parsing message text. A write resolves only once its transaction has committed. Nothing is swallowed: whether a failure degrades a load is the CachePolicy's decision.

Constructors1
new(nameOrOptions: IndexedDbStoreOptionsConstruction options for IndexedDbStore. | string): IndexedDbStore
Methods5
clear(namespace?: string): Promise<void>
Removes every record of namespace, or the whole store when it is omitted.
destroy(): void
Synchronously releases any open handles held by the store.
Writes one record, replacing any existing one. Must not resolve before the write is durable in whatever sense the backend offers. A backend with transactions resolves on commit, not on the write request being accepted - otherwise a caller that awaits a write and then reads it back can miss.
Properties1
id: string
Stable identifier for this store, used in diagnostics to name which store of a multi-store route failed.
Source