title: get `keyof` non-optional property names in typescript
body: <p>This is my interface</p>
  
  <pre><code>interface X {
      key: string
      value: number | undefined
      default?: number
  }
  </code></pre>
  
  <p>But I want the non-optional keys only, aka. <code>"key" | "value"</code>, or just <code>"key"</code> (both will do fine for me)</p>
  
  <p><code>type KeyOfX = keyof X</code> gives me <code>"key" | "value" | "default"</code>. </p>
  
  <pre><code>type NonOptionalX = {
      [P in keyof X]-?: X[P]
  }
  </code></pre>
  
  <p><code>type NonOptionalKeyOfX = keyof NonOptionalX</code> gives <code>"key" | "value" | "default"</code> as <code>-?</code> only removes the optional modifier and make all of them non-optional.</p>
  
  <p>ps. I use Typescript 2.9. </p>