Let's say there is a function to create an object.
interface Params {
name: string
}
const createTypedObject = (params: Params) => ({
[params.name]: 1,
})
I create an object
const obj = createTypedObject({ name: 'test' })
// Type obj {[p: string]: number}
How to make object type be {test: number}?