diff --git a/package.json b/package.json index 7a75dcb..32f4656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chrome-extension-toolkit", - "version": "0.0.68", + "version": "0.0.69`", "description": "A template for creating npm packages using TypeScript and VSCode", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/storage/createStore.ts b/src/storage/createStore.ts index 943e124..2c0195f 100644 --- a/src/storage/createStore.ts +++ b/src/storage/createStore.ts @@ -86,9 +86,12 @@ export type Store = { * @param key the key to get the value of or null to get the entire store * @returns a tuple containing the value of the specified key, and a function to set the value */ - use : T>( + use( key: K - ): [D, (value: D) => Promise]; + ): [ + K extends keyof T ? Serializable : T, + (value: K extends keyof T ? Serializable : Partial>) => Promise + ]; /** * A react hook that allows you to get and set the value of the specified key in the store from a functional component. @@ -100,7 +103,7 @@ export type Store = { defaultValue: K extends keyof T ? Serializable : T ): [ K extends keyof T ? Serializable : T, - (value: K extends keyof T ? Serializable : T) => Promise + (value: K extends keyof T ? Serializable : Partial>) => Promise ]; /**