title: Object index key type in Typescript
body: <p>I defined my generic type as</p>
  <pre><code>interface IDictionary&lt;TValue&gt; {
      [key: string|number]: TValue;
  }
  </code></pre>
  <p>But TSLint's complaining. How am I supposed to define an object index type that can have either as key? I tried these as well but no luck.</p>
  <pre><code>interface IDictionary&lt;TKey, TValue&gt; {
      [key: TKey]: TValue;
  }
  
  interface IDictionary&lt;TKey extends string|number, TValue&gt; {
      [key: TKey]: TValue;
  }
  
  type IndexKey = string | number;
  
  interface IDictionary&lt;TValue&gt; {
      [key: IndexKey]: TValue;
  }
  
  interface IDictionary&lt;TKey extends IndexKey, TValue&gt; {
      [key: TKey]: TValue;
  }
  </code></pre>
  <p><strong>None of the above work.</strong></p>
  <h2>So how then?</h2>