title: Why is this Typescript erroring "This expression is not callable"?
body: <p>I have the following Typescript code and the IDE is telling me that &quot;This expression is not callable. Type 'Pick&lt;IUserContext, &quot;clearAllLoginData&quot;&gt;' has no call signatures.&quot; but I don't understand why.</p>
  <p>To my understanding, the <code>clearAllLoginData</code> parameter of the <code>logout</code> function should be of type <code>() =&gt; void</code>, since it is <code>Pick</code>ed from the <code>IUserContext</code> interface.</p>
  <p>Any pointers appreciated!</p>
  <pre><code>interface IUserContext {
      id?: number;
      email?: string;
      fname?: string;
      lname?: string;
      slname?: string;
      companyId?: number;
      companyName?: string;
      clearAllLoginData: () =&gt; void;
      setAllLoginData: () =&gt; void;
    }
  
  
  interface LogoutParams {
      clearAllLoginData: Pick&lt;IUserContext, &quot;clearAllLoginData&quot;&gt;;
      afterLogout?: () =&gt; void;
  }
  
  export const logout = ({ clearAllLoginData, afterLogout }: LogoutParams):void =&gt; {
      clearAllLoginData(); // &lt;---- Error: &quot;This expression is not callable&quot;
      if (afterLogout) {
        afterLogout();
      }
  };
  </code></pre>