title: Typescript : enforce generics to have some keys compulsory
body: <p>I want the below function should only accept <code>data</code> object if there is <code>id</code> key in it. And then, want to access <code>id</code> from <code>data</code>.</p>
  
  <pre class="lang-js prettyprint-override"><code>function someFuntion&lt;T&gt;(data : T){
  const id = data['id']  //Error : Element implicitly has an 'any' type because type '{}' has no index signature.
  }
  </code></pre>
  
  <p>Is it possible?</p>