I have a interface
interface User {
firstName: string;
secondName: string;
age: number;
}
I wanted to create a new type with different value type
type CustomT = { regex: RegExp }
interface UserWithRegexp {
firstName: CustomT;
secondName: CustomT;
age: CustomT;
}
How can i refractor the UserWithRegexp type by using the User interface
I am expecting to have something like thistype UserWithRegexp = { [key of User] : CustomT }