Can Typescript support a structure similar to this?
class Currency {
last_updated: number;
constructor(public { id: string, name: string }) {}
}
So that the class Currency
can accept an object with properties like id: string
, name: string
and automatically assign them as public attributes of the class instance.