I need to have the implementation of such PropsWithType type:
type PropsWithType<TType, TProp> = ...
type Person = {
firstname: string
lastname: string
age: number
}
const personName: PropsWithType<Person, string> = {
firstName: 'Peter',
lastName: 'Jackson',
}
const personAge: PropsWithType<Person, number> = {
age: 20
}
This example is actually useless but this type will be used for generic factories, which will need to provide resolvers for props typed as object.