title: Typescript: property key based on type
body: <p>Is it possible to define a property name based on the generic type passed?</p>
  <pre><code>type Foo&lt;T&gt; = {
    // magic goes here
    someProp: boolean
  };
  
  enum MyEnum {
    red = 'red',
    blue= 'blue',
  }
  
  const d: Foo&lt;MyEnum.blue&gt; = null;
  d.someProp
  d.blue // Property 'blue' does not exist on type 'Foo&lt;MyEnum.blue&gt;'.ts(2339)
  </code></pre>
  <p>Been looking all over the docs, but I can't figure it out.</p>