Skip to content

Commit

Permalink
docs: add experimental link for raw support
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 6, 2023
1 parent b379e71 commit 98a6466
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Comparing to similar solutions like [localforage](https://localforage.github.io/
- [Storage Interface](#storage-interface)
- [`storage.hasItem(key)`](#storagehasitemkey)
- [`storage.getItem(key)`](#storagegetitemkey)
- [`storage.getItemRaw(key)`](#storagegetitemrawkey)
- [`storage.setItem(key, value)`](#storagesetitemkey-value)
- [`storage.setItemRaw(key, value)`](#storagesetitemrawkey-value)
- [`storage.removeItem(key, removeMeta = true)`](#storageremoveitemkey-removemeta--true)
- [`storage.getMeta(key, nativeOnly?)`](#storagegetmetakey-nativeonly)
- [`storage.setMeta(key)`](#storagesetmetakey)
Expand Down Expand Up @@ -119,7 +121,9 @@ Gets the value of a key in storage. Resolves to either a javascript primitive va
await storage.getItem("foo:bar");
```

### `storage.getItemRaw(key)` (experimental)
### `storage.getItemRaw(key)`

**Note:** This is an experimental feature. Please check [unjs/unstorage#142](https://github.com/unjs/unstorage/issues/142) for more information.

Gets the value of a key in storage in raw format.

Expand All @@ -140,7 +144,9 @@ If value is `undefined`, it is same as calling `removeItem(key)`.
await storage.setItem("foo:bar", "baz");
```

### `storage.setItemRaw(key, value)` (experimental)
### `storage.setItemRaw(key, value)`

**Note:** This is an experimental feature. Please check [unjs/unstorage#142](https://github.com/unjs/unstorage/issues/142) for more information.

Add/Update a value to the storage in raw format.

Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export interface Storage {
// Item
hasItem: (key: string) => Promise<boolean>;
getItem: (key: string) => Promise<StorageValue>;
/** @experimental */
/** @experimental See https://github.com/unjs/unstorage/issues/142 */
getItemRaw: (key: string) => Promise<any>;
setItem: (key: string, value: StorageValue) => Promise<void>;
/** @experimental */
/** @experimental See https://github.com/unjs/unstorage/issues/142 */
setItemRaw: (key: string, value: any) => Promise<void>;
removeItem: (key: string, removeMeta?: boolean) => Promise<void>;
// Meta
Expand Down

0 comments on commit 98a6466

Please sign in to comment.