title: Get List of all types of a certain string-type
body: <p>I had this typescript generated by the generateTypeScript-gradle plugin. </p>
  
  <pre><code>export type FoodUnit = "AS_NEEDED" | "G" | "KG" | "ML" | "L" | "JAR" | "CAN" | "PIECE" | "BUNCH" | "HANDFUL" | "STALK" | "SLICE" | "TABLESPOON" | "TEASPOON" | "DROP" | "CUP" | "TWIG";
  </code></pre>
  
  <p>Now I want to have a list of all possible units in a class. </p>
  
  <pre><code>  units:FoodUnit[] = ["AS_NEEDED", "G", "KG" .....
  </code></pre>
  
  <p>Is there a way to instead write </p>
  
  <pre><code>  units:FoodUnit[] = FoodUnit.values()
  </code></pre>
  
  <p>like I would in Java?</p>