export class Test {
public name: string;
public type: string;
constructor(props) {
Object.keys(props).map(item => {
if(this.hasOwnProperty(item)) {
this[item] = props[item]
}
})
}
}
const test = new Test({ name: 'Dima' });
console.log(test);