title: Typescript infer the returned array type elements
body: <p>I have the following function:</p>
  
  <pre><code>const data = {
    id: 1,
    name: '',
  }
  
  type keysType = keyof(typeof data);
  
  function getKeysValues(...keys: keysType[]) {
    return keys.map(k =&gt; data[k]);
  }
  
  const value = getKeysValues('id', 'name');
  </code></pre>
  
  <p>The type of <code>value</code> is <code>(string | number)[]</code>. How can I change it to be dynamic based on the passed keys? So, in the above case I'm expecting the type to be <code>[number, string]</code>.</p>