Skip to content

MemoryStorage

Defined in: console-sdk/src/testing/memoryStorage.ts:29

The /testing storage handle (SDK_PLAN.md §3.11.2): a full StorageAdapter — pass it as config.storage, or receive one from createTestConfig() — extended with synchronous inspection helpers over the live backing map. The adapter half is the exact production in-memory implementation (memoryStorage() from the root entry); the helpers are a read/reset layer over the same Map.

clear(): void

Defined in: console-sdk/src/testing/memoryStorage.ts:49

Removes every stored entry — the fresh-install state. Synchronous, so a test can reset between phases without awaiting.

void


entries(): ReadonlyMap<string, string>

Defined in: console-sdk/src/testing/memoryStorage.ts:35

Snapshot of every stored entry, keyed by the physical storage key (namespace prefix included, exactly as an injected adapter would see it). A fresh map per call — mutating it never touches the store.

ReadonlyMap<string, string>


getAllKeys(prefix): Promise<string[]>

Defined in: console-sdk/src/storage/types.ts:46

Resolves every stored key that starts with prefix (pass '' for all keys). Order is unspecified.

string

Promise<string[]>

StorageAdapter.getAllKeys


getItem(key): Promise<string | null>

Defined in: console-sdk/src/storage/types.ts:37

Resolves the value stored under key, or null when absent.

string

Promise<string | null>

StorageAdapter.getItem


removeItem(key): Promise<void>

Defined in: console-sdk/src/storage/types.ts:41

Removes key; resolves normally whether or not the key existed.

string

Promise<void>

StorageAdapter.removeItem


savedDevices(): ReadonlyMap<DeviceId, unknown>

Defined in: console-sdk/src/testing/memoryStorage.ts:43

Typed view of the persisted saved-device records (the SDK’s only durable state, SDK_PLAN.md §3.1.3), keyed by branded DeviceId. Values are the JSON-parsed record payloads; a value that is not valid JSON is returned as the raw string rather than dropped.

ReadonlyMap<DeviceId, unknown>


setItem(key, value): Promise<void>

Defined in: console-sdk/src/storage/types.ts:39

Stores value under key, overwriting any existing value.

string

string

Promise<void>

StorageAdapter.setItem