API reference: @salmonui/data/storage
KeyValueStoreinterface
import type { KeyValueStore } from '@salmonui/data/storage';Also exported from @salmonui/data.
interface KeyValueStore {
getItem(key: string): string | null | undefined | Promise<string | null | undefined>;
setItem(key: string, value: string): void | Promise<void>;
removeItem(key: string): void | Promise<void>;
}
Any sync or async key-value store (localStorage, sessionStorage, IndexedDB wrappers, Redis clients, Maps).
| Name | Signature | Description |
|---|---|---|
getItem | getItem(key: string): string | null | undefined | Promise<string | null | undefined>; | |
setItem | setItem(key: string, value: string): void | Promise<void>; | |
removeItem | removeItem(key: string): void | Promise<void>; |