API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classIndexedDbStore
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.
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.
new(nameOrOptions: IndexedDbStoreOptionsConstruction options for IndexedDbStore. | string): IndexedDbStoreclear(namespace?: string): Promise<void>destroy(): voidget(key: CacheRecordKeyThe identity of one persisted cache record. A SourceKey alone is deliberately not enough. It carries no asset type - two types may acquire one URL and keep ent…): Promise<CacheReadResultThe outcome of reading one cache record. A miss and a failure are deliberately different things: a miss resolves to `{ hit: false }`, a store that could not an…>id: string