interface User { name: string; age: number; }
type CapitalizeProperties<T> = { [Property in keyof T as Capitalize<string & Property>]: T[Property]; };
type CUser = CapitalizeProperties<User>;
var c : CUser = { Age: 17, Name: "john" }
You can check that the autocompletion works on the c variable.
https://www.typescriptlang.org/play?ssl=1&ssc=1&pln=15&pc=2#...
interface User { name: string; age: number; }
type CapitalizeProperties<T> = { [Property in keyof T as Capitalize<string & Property>]: T[Property]; };
type CUser = CapitalizeProperties<User>;
var c : CUser = { Age: 17, Name: "john" }
You can check that the autocompletion works on the c variable.
https://www.typescriptlang.org/play?ssl=1&ssc=1&pln=15&pc=2#...