From d14e1a723e5f19cfa89f439d2f0444cc4f5f6dfc Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 20 Jan 2025 09:16:53 +0100 Subject: [PATCH] fix(types): support for Vue 2.7 --- packages/pinia/src/types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/pinia/src/types.ts b/packages/pinia/src/types.ts index 4ca20da9..085bb39f 100644 --- a/packages/pinia/src/types.ts +++ b/packages/pinia/src/types.ts @@ -474,7 +474,9 @@ export type _StoreWithGetters_Writable = { ? K : // NOTE: there is still no way to have a different type for a setter and a getter in TS with dynamic keys // https://github.com/microsoft/TypeScript/issues/43826 - never]: G[K] extends WritableComputedRef ? R : never + // NOTE: to support Vue 2.7, we need to use Readonly and not infer the second type param + // https://github.com/vuejs/pinia/issues/2767#issuecomment-2601284366 + never]: G[K] extends Readonly> ? R : never } /** -- 2.47.3