title: How to infer interface's property type from generic Key?
body: <p>I wanna infer interface's property type from generic key</p>
  <p>For example:</p>
  <pre class="lang-js prettyprint-override"><code>interface Api {
    foo: (p: string) =&gt; number;
    bar: (p: number) =&gt; string;
    baz: () =&gt; number[];
  }
  </code></pre>
  <p>Just call api from key.
  But this not worked</p>
  <pre class="lang-js prettyprint-override"><code>const api: Api;
  
  function callApi&lt;K extends keyof Api&gt;(apiName: K, ...params: Parameters&lt;Api[K]&gt;) {
    // Expected 1 arguments, but got 0 or more.
    // An argument for 'p' was not provided.
    // actually, params is [string] | [number] | [], should be matched
    api[apiName](...params);
  
    // How to fix this?
    // when apiName is 'foo', params must be `[string]`
    // when apiName is 'bar', params must be `[number]`
    // when apiName is 'foo', params must be `[]`
  }
  
  </code></pre>
  <p>But this works</p>
  <pre class="lang-js prettyprint-override"><code>callApi('foo', 1); // Argument of type 'number' is not assignable to parameter of type 'string'.
  callApi('bar', '1'); // Argument of type 'string' is not assignable to parameter of type 'number'
  </code></pre>