title: Typescript - Exclude keys of other type in argument
body: <p>I have the following scenario.</p>
  
  <pre><code>function foo&lt;A extends object, B extends A&gt;(
    a: A,
    b: Pick&lt;B, Exclude&lt;keyof B, keyof A&gt;&gt;
  ): B {
    return undefined as any;
  }
  
  const r = foo&lt;{ a: string }, { a: string; b: number }&gt;({ a: "" }, { b: 2 });
  </code></pre>
  
  <p>I would like for <code>b</code> to be an object that only has keys that are not in <code>a</code>. But I also want to get the type of the resulting object when merging them together.</p>