I would like to do something like this:
interface IPoint {
x : number;
y : number;
z? : number;
}
const diag : IPoint = IPoint.x(1)
.y(2)
.build();
I realize I could implement this myself, but was wondering if there was an automatic way to do this? given TypeScript already knows the type information.
Edit: I am requesting this kind of syntax because I can do this currently.
const diag : IPoint = {x: 1, y: 1};