I would like to do something like this:
interface IPoint {
x : number;
y : number;
z? : number;
}
const diag : IPoint = IPoint.x(1)
Based on the previous answers I wrote a generic Typescript builder which provides:
If you are interested, you can find further information and examples here: https://github.com/hanterlantant/ts-generic-builder And the npm package here: https://www.npmjs.com/package/ts-generic-builder