title: Typescript: keyof another parameter?
body: <p>I'm making a function that works with any object like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>function deleteKey (obj, key) {
    // This is just for an example, but you will get what kind of typing needed.
    delete obj[key];
  }
  </code></pre>
  
  <p>How can I give typing in Typscript correctly? Is there a good way to use <code>keyof</code> a parameter like this?</p>
  
  <pre class="lang-js prettyprint-override"><code>function deleteKey (obj: object, key: keyof obj) {
    // This is just for an example, but you will get what kind of typing needed.
    delete obj[key];
  }
  </code></pre>