title: Typescript interface + constants vs class for defining enum-like object
body: <p>I am new to typescript, and I am trying to define an enum-like class with some additional attributes. I have seen there are two different approaches of doing this:</p>
  <ol>
  <li>Using a class, similar to what I would do in Java:</li>
  </ol>
  <pre><code>export class AwsRegion {
   
       public static US_EAST_1 = new AwsRegion('us-east-1');
       public static EU_WEST_1 = new AwsRegion('eu-west-1');
       public static US_WEST_2 = new AwsRegion('us-west-2');
   
       private name: string;
   
       constructor(name: string) {
           this.name = name;
       }
   
       public getName(): string {
           return this.name;
       }
   }
  
  </code></pre>
  <ol start="2">
  <li>Using interface + typescript constants:</li>
  </ol>
  <pre><code> export interface AwsRegion {
       readonly name: string;
   }
  
  export const US_EAST_1: AwsRegion = { name: 'us-east-1' };
  export const EU_WEST_1: AwsRegion = { name: 'eu-west-1' };
  export const US_WEST_2: AwsRegion = { name: 'us-west-2' };
  </code></pre>
  <p>Is there any advantage to any of the two, or one that is more idiomatic in typescript than the other?</p>
  <p>Thanks,</p>