title: TypeScript map with keys having multiple types
body: <p>How to declare a map in typescript where the key could be a string | number and the value could be for example a number.</p>
  
  <p>I'm trying the following and get an error</p>
  
  <pre><code>let aMap : { [key: string | number]: number } = {}
  </code></pre>
  
  <p>I get the following error in VS Code</p>
  
  <blockquote>
    <p>[ts] An index signature parameter type must be 'string' or 'number'.</p>
  </blockquote>
  
  <p>Note: I do not want to use the keyword "Map" in typescript. As just declaring: </p>
  
  <p><code>let aMap : { [key: string]: number } = {}</code>
  works fine, I'm just having issues creating map with multiple key types</p>