title: TypeScript - check if object's property is a function with given signature
body: <p>I have a function that gets a property from an object. </p>
  
  <pre><code>// Utils.ts
  export function getProperty&lt;T, K extends keyof T&gt;(obj: T, key: string): T[K] {
      if (key in obj) { return obj[key as K]; }
      throw new Error(`Invalid object member "${key}"`);
  }
  </code></pre>
  
  <p>I'd like to check if returned property is a function with given signature and then call the property with provided parameter.</p>
  
  <p><code>getProperty()</code> is used to dynamically get one of object's method and call it. I tried:</p>
  
  <pre><code>let property: this[keyof this] = utils.getProperty(this, name);
  if (typeof property === 'function') ) { property(conf); }
  </code></pre>
  
  <p>But this gives "Cannot invoke an expression whose type lacks a call signature. Type 'any' has no compatible call signatures." error. I understand that a property that comes from <code>getProperty()</code> can indeed be of any type but how to ascertain it is a function with <code>(conf: {}): void</code> signature?</p>