Let's say you have a simple ES6 class and you'd like to extract constructor parameters into its own type to be DRY. E.g.
type FooParams = {
a: string;
b: number;
c: boolean;
};
export class Foo {
public a: string;
public b: number;
public c: boolean;
constructor({ a, b, c }: FooParams) {
this.a = a;
this.b = b;
this.c = c;
}
}
How can I avoid repeating class properties since they as exactly the same as type?