title: How to filter union of object type by property in Typescript?
body: <p>Imagine the following simplified setup:</p>
  
  <pre class="lang-js prettyprint-override"><code>import { Action, AnyAction } from 'redux'; // interface Action&lt;Type&gt; { type: Type } and type AnyAction = Action&lt;any&gt;
  
  export type FilterActionByType&lt;
    A extends AnyAction,
    ActionType extends string
  &gt; = A['type'] extends ActionType ? A : never;
  
  type ActionUnion = Action&lt;'count/get'&gt; | Action&lt;'count/set'&gt;;
  
  type CountGetAction = FilterActionByType&lt;ActionUnion, 'count/get'&gt;;
  // expected: Action&lt;'count/get'&gt;
  // received: never
  
  </code></pre>
  
  <p>Is there a way to accomplish this? (typescript 3.7 is an option)</p>