title: Pick one key-value pair from type
body: <p>I have following type:</p>
  
  <pre><code>type Example = {
    key1: number,
    key2: string
  }
  </code></pre>
  
  <p>and I need to create type based on <code>Example</code> type to be one of <code>key: value</code> pair. Of course I'm looking for generic solution. Here is what this type should return:</p>
  
  <pre><code>type Example2 = { ... };
  const a: Example2 = { key3: 'a' } // incorrect
  const b: Example2 = { key1: 'a' } // incorrect
  const c: Example2 = { key2: 1 } // incorrect
  const d: Example2 = { key1: 1 } // correct
  const e: Example2 = { key2: 'a' } // correct
  const f: Example2 = { key1: 1, key2: 'a' } // incorrect
  </code></pre>
  
  <p>I was trying using this:</p>
  
  <pre><code>type GetOne&lt;T&gt; = { [P in keyof T]: T[P] };
  type Example2 = GetOne&lt;Example&gt;;
  </code></pre>
  
  <p>but it returns all the properties and example with <code>const f</code> not working as expected.</p>