Is your feature request related to a problem? Please describe
When you're building a query and you use the .only() method you lose the typing because typescript only infers Pick<ParsedContent, string> and not Pick<ParsedContent, "whatever-you-specified">.
I had this problem when using queryContent("...").only(["...","..."]).findSurround()
Describe the solution you'd like
The solution would be using <const K extends keyof T> instead of <K extends keyof T>
The const type parameter was introduced with Typescript 5.0
Is your feature request related to a problem? Please describe
When you're building a query and you use the
.only()
method you lose the typing because typescript only infersPick<ParsedContent, string>
and notPick<ParsedContent, "whatever-you-specified">
. I had this problem when using queryContent("...").only(["...","..."]).findSurround()Describe the solution you'd like
The solution would be using
<const K extends keyof T>
instead of<K extends keyof T>
The const type parameter was introduced with Typescript 5.0Describe alternatives you've considered
Letting it stay this way
Additional context