# KeyValueStore (@salmonui/data/storage)

> The KeyValueStore interface of @salmonui/data/storage: Any sync or async key-value store (localStorage, sessionStorage, IndexedDB wrappers, Redis clients, Maps).

Canonical: https://salmonui.dev/docs/reference/data/storage/KeyValueStore

```ts
import type { KeyValueStore } from '@salmonui/data/storage';
```

Also exported from `@salmonui/data`.

Entry index: https://salmonui.dev/docs/reference/data/storage (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data/storage.md).

## Reference

Kind: interface

```ts
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).

Members (3):

| Name | Signature | Flags | 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>;` |  |  |
