How can I fix the following type error?
Argument of type 'Query' is not assignable to parameter of type 'Input'. Index signature is missing in type 'Query'.(2345)
I am using the Input type as a generic type (catch-all) for query strings. When I feed an input of type Query, the error is thrown but the underlying JavaScript code runs just fine.
interface Query {
lorem: "0" | "1"
ipsum: string
}
const query: Query = {
lorem: "0",
ipsum: "Hello world"
}
interface Input {
[key: string]: string
}
const test = (input: Input) => {
return input["lorem"]
}
test(query)