Is there a way to limit the indexed access type to only return the type of the key specified?
interface User {
id: string,
name: string,
age: number,
token: string | null,
}
interface Updates<Schema> {
set: Partial<Record<keyof Schema, Schema[keyof Schema]>;
}
const test: Updates<User> = {
set: {
name: 1 // Trying to assign number to name should not work
}
}