title: Limit generic type (<T>(p: T)=>T, T can be only some specific types)
body: <p>Any one knows how to make typescript for a function look like this?</p>
  <pre><code>const fn = &lt;T&gt;(props: T) =&gt; { ...logics which will reuse &lt;T&gt;...}
  </code></pre>
  <p>But T can be only one of boolean or { b: string; }</p>