title: Typescript union type for keys, infer type for dictionary values
body: <p>I am trying to write a type which expresses the below without needing to explicitly create a type for the translations dictionary.</p>
  <pre><code>type Language = &quot;english&quot; | &quot;german&quot; | &quot;french&quot;;
  
  const translations = {
    english: {
      foo: &quot;foo&quot;,
      bar: &quot;bar&quot;
    },
    german: {
      foo: &quot;föö&quot;
    }
  };
  </code></pre>
  <p>I have come up with this</p>
  <pre><code>type Translations = {english: T, } &amp; {[key in Language]?: Partial&lt;T&gt;};
  </code></pre>
  <p>but this doesn't quite satisfy my requirements, as <code>T</code> still needs to be passed to the type parameter...</p>