@weser/storage 0.0.18 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as useStorage } from './useStorage.js';
1
+ export { default as useStorage, type T_SyntheticStorage } from './useStorage.js';
2
2
  export { default as useLocalStorage } from './useLocalStorage.js';
3
3
  export { default as useSessionStorage } from './useSessionStorage.js';
4
4
  export { default as useIndexedStorage } from './useIndexedStorage.js';
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- type SyntheticStorage<T = any> = {
2
+ export type T_SyntheticStorage<T = any> = {
3
3
  getItem: (key: string) => T | Promise<T>;
4
4
  setItem: (key: string, value: T) => void | Promise<void>;
5
5
  };
@@ -8,5 +8,4 @@ export type Config<T> = {
8
8
  encode?: (value: T) => any;
9
9
  decode?: (value: any) => T;
10
10
  };
11
- export default function useStorage<T = any>(getStorage: () => Storage | SyntheticStorage, key: string, initialState: T, config?: Config<T>): [T, Dispatch<SetStateAction<T>>, boolean];
12
- export {};
11
+ export default function useStorage<T = any>(getStorage: () => Storage | T_SyntheticStorage, key: string, initialState: T, config?: Config<T>): [T, Dispatch<SetStateAction<T>>, boolean];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weser/storage",
3
- "version": "0.0.18",
4
- "description": "React hooks for working with persisted state",
3
+ "version": "1.0.0",
4
+ "description": "Utils and React hooks for working with persisted state",
5
5
  "author": "Robin Weser <robin@weser.io>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/robinweser/weser.git",
@@ -60,5 +60,5 @@
60
60
  "rimraf": "^3.0.2",
61
61
  "typescript": "^5.4.5"
62
62
  },
63
- "gitHead": "4dd312c8cf505d0c06d25ca489b893a6c6c0d9fe"
63
+ "gitHead": "afc0628ca4aeaba255eef9716652640fdc5b50c4"
64
64
  }