title: Getting type of a property of a typescript class using keyof operator
body: <p>As stated in the documentation of Typescript about the <code>keyof</code> operator, one can get a property of an object instance using the function below.</p>
  
  <pre><code>function getProperty&lt;T, K extends keyof T&gt;(o: T, name: K) {
      return o[name];
  }
  </code></pre>
  
  <p>Of course, one can get the type of the property by replacing <code>return o[name]</code> into <code>return typeof o[name]</code>. Is there a way to retrieve the type of the property <strong>without passing any object instance</strong>?</p>
  
  <pre><code>function getPropertyType&lt;T&gt;(name: keyof T) {
      // something like T[name]?
  }
  </code></pre>