title: Get index type of an array literal
body: <p>Assume I have the following array literal:</p>
  
  <pre><code>const list = ['foo', 'bar', 'baz'] as const;
  </code></pre>
  
  <p>I'm trying to generate a type which represents possible indices of this array. I tried to implement this as follows:</p>
  
  <pre><code>const list = ['foo', 'bar', 'baz'] as const;
  
  type ListIndex = Exclude&lt;keyof (typeof list), keyof []&gt;;
  </code></pre>
  
  <p>but that <code>ListIndex</code> now becomes <code>"0" | "1" | "2"</code> instead of <code>0 | 1 | 2</code>.</p>
  
  <p>Can anyone tell me how to get the desired <code>0 | 1 | 2</code> type?</p>