title: Using wildcard in typescript generics
body: <p>This might be a simple solution and I just did not come across it yet. Given a typescript function like <code>func&lt;T, D = any&gt;(param1: T, param2: D) { ... }</code> and I call it with two parameters <code>param1</code> and <code>param2</code>. Is it possible to specify the type of <code>D</code> without specifying the type of <code>T</code> so that typescript still infers the type of <code>T</code> but enforces the type of <code>D</code>?</p>
  
  <p><strong>Example:</strong> Let's say I want to enforce that this function is called with the type of an external interface definition:</p>
  
  <pre><code>export interface Data {
    field1: string;
    field2: boolean;
  }
  </code></pre>
  
  <p>I can now either use <code>func('Hello', {field1: 'World', field2: true})</code> (this will not ensure that <code>param2</code> is a valid <code>Data</code> object) or I can use <code>func&lt;string, Data&gt;('Hello', {field1: 'World', field2: true})</code>. What I <strong>don't want</strong> to do is <code>func&lt;any, Data&gt;('Hello', {field1: 'World', field2: true})</code>. Is there a solution for this?</p>