I have this:
type Two = {
one: number,
two: string,
three: boolean
}
I want it to create a type that would look like this:
You need to use a mapped type for the renamed property as well:
type Two = {
one: number,
two: string,
three: boolean
}
type Rename = Pick> & { [P in N]: T[K] }
type Renamed = Rename
Note that this will not work as expected if you provide more properties:
type Renamed = Rename // will be Pick & {
// four: string | boolean;
// five: string | boolean;
// }