From b23611041c479a0aa0994b231c9e560f8e50961c Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Wed, 24 Apr 2024 18:15:50 -0500 Subject: [PATCH] updated use hook to now allow pulling in the entire object --- package.json | 2 +- src/storage/createStore.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0cc4083..30178d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chrome-extension-toolkit", - "version": "0.0.69", + "version": "0.0.70", "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 2c0195f..29d0076 100644 --- a/src/storage/createStore.ts +++ b/src/storage/createStore.ts @@ -89,7 +89,7 @@ export type Store = { use( key: K ): [ - K extends keyof T ? Serializable : T, + K extends keyof T ? Serializable : Serializable, (value: K extends keyof T ? Serializable : Partial>) => Promise ]; @@ -100,9 +100,9 @@ export type Store = { */ use( key: K, - defaultValue: K extends keyof T ? Serializable : T + defaultValue: K extends keyof T ? Serializable : Serializable ): [ - K extends keyof T ? Serializable : T, + K extends keyof T ? Serializable : Serializable, (value: K extends keyof T ? Serializable : Partial>) => Promise ];