In TypeScript it\'s possible to create a class with a constructor that takes parameter with access modifiers and it automatically convert those parameters in class fields.>
You can achieve similar behavior by creating an interface:
interface IProps { id: number; updatedAt: number; createdAt: number; } class Item { constructor(public props: IProps) {} } const item = new Item({ id: 1, updatedAt: 1, createdAt: 1 }); console.log(item.props.id);