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.
Extends
Section titled “Extends”Methods
Section titled “Methods”clear()
Section titled “clear()”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.
Returns
Section titled “Returns”void
entries()
Section titled “entries()”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.
Returns
Section titled “Returns”ReadonlyMap<string, string>
getAllKeys()
Section titled “getAllKeys()”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.
Parameters
Section titled “Parameters”prefix
Section titled “prefix”string
Returns
Section titled “Returns”Promise<string[]>
Inherited from
Section titled “Inherited from”getItem()
Section titled “getItem()”getItem(
key):Promise<string|null>
Defined in: console-sdk/src/storage/types.ts:37
Resolves the value stored under key, or null when absent.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string | null>
Inherited from
Section titled “Inherited from”removeItem()
Section titled “removeItem()”removeItem(
key):Promise<void>
Defined in: console-sdk/src/storage/types.ts:41
Removes key; resolves normally whether or not the key existed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”savedDevices()
Section titled “savedDevices()”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.
Returns
Section titled “Returns”ReadonlyMap<DeviceId, unknown>
setItem()
Section titled “setItem()”setItem(
key,value):Promise<void>
Defined in: console-sdk/src/storage/types.ts:39
Stores value under key, overwriting any existing value.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”Promise<void>