From: Eduardo San Martin Morote Date: Mon, 20 Jan 2025 08:16:53 +0000 (+0100) Subject: fix(types): support for Vue 2.7 X-Git-Tag: v2.3.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d14e1a723e5f19cfa89f439d2f0444cc4f5f6dfc;p=thirdparty%2Fvuejs%2Fpinia.git fix(types): support for Vue 2.7 --- 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 } /**