API reference

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

I

interfaceKeyValueStore

@codexo/exojs / assets / stable

Async key/value store for application data - game saves, settings, profiles, cached payloads. A single, uniform surface so calling code does not care whether the backing store is synchronous or asynchronous. The backend is the axis you choose by capability, not a flag: - WebStorageStore - `localStorage`/`sessionStorage`: small, synchronous, JSON-only (no Blobs/ArrayBuffers). The moral successor of the old `JsonStore`. - IndexedDbKeyValueStore - IndexedDB: large, structured-clone, so Blobs, `ArrayBuffer`s and nested objects round-trip without JSON. - MemoryStore - in-memory: ephemeral, holds references directly. For tests and throwaway data. Pair with Scene.serialize / Scene.deserialize for a save system: `store.set(slot, scene.serialize())` to save, `scene.deserialize(await store.get(slot))` to restore. Slot naming, profiles and autosave policy are the game's concern, not the engine's.

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

Async key/value store for application data - game saves, settings, profiles, cached payloads. A single, uniform surface so calling code does not care whether the backing store is synchronous or asynchronous.

The backend is the axis you choose by capability, not a flag: - WebStorageStore - `localStorage`/`sessionStorage`: small, synchronous, JSON-only (no Blobs/ArrayBuffers). The moral successor of the old `JsonStore`. - IndexedDbKeyValueStore - IndexedDB: large, structured-clone, so Blobs, `ArrayBuffer`s and nested objects round-trip without JSON. - MemoryStore - in-memory: ephemeral, holds references directly. For tests and throwaway data.

Pair with Scene.serialize / Scene.deserialize for a save system: `store.set(slot, scene.serialize())` to save, `scene.deserialize(await store.get(slot))` to restore. Slot naming, profiles and autosave policy are the game's concern, not the engine's.

Methods5
clear(): Promise<boolean>
Remove every entry owned by this store. Resolves true on success.
delete(key: string): Promise<boolean>
Remove the entry at key. Resolves true if one existed and was removed.
get(key: string): Promise<T | null>
Read the value at key, or null when absent.
has(key: string): Promise<boolean>
Whether an entry exists at key.
set(key: string, value: unknown): Promise<void>
Write value at key, replacing any existing entry.
Source