Reference / @getenginex/sdk / StorageLike
StorageLike
Minimal storage accepted by localStorageTokenStore: only the three methods it uses, without depending on lib.dom's Storage — so the published type compiles in projects without that lib (e.g. moduleResolution: "node16"/"bundler" without DOM, common in Node packages). The browser's localStorage matches StorageLike structurally without any cast; any other object with those three methods (a test mock, a synchronous cookie/IndexedDB adapter) also works.
Methods
getItem()
getItem(
key):string|null
Reads the key's value, or null if it does not exist.
Parameters
key
string
Returns
string | null
removeItem()
removeItem(
key):void
Removes the key.
Parameters
key
string
Returns
void
setItem()
setItem(
key,value):void
Writes the value to the key.
Parameters
key
string
value
string
Returns
void