Skip to content

Commit

Permalink
fix(types): support for Vue 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 20, 2025
1 parent fc8c28b commit d14e1a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pinia/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ export type _StoreWithGetters_Writable<G> = {
? 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<infer R, infer _S> ? 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<WritableComputedRef<infer R>> ? R : never
}

/**
Expand Down

0 comments on commit d14e1a7

Please sign in to comment.