title: Use Enum as restricted key type in Typescript
body: <p>The question is can enum be used as a key type instead of only "number" or "string" ? Currently it seems like the only possible declaration is x:{[key:number]:any} where key can be of type "number" or "string". Is it possible to make something like in this example:</p>
  
  <p>Example:</p>
  
  <pre><code>enum MyEnum
  {
      First,
      Second
  }
  
  var layer:{[key:MyEnum]:any};
  </code></pre>