title: TypeScript type with properties of an object containing a specific type
body: <p>I want to make a generic type <code>CompatibleProp&lt;T, U&gt;</code> which would resolve to a string type containing all the properties of <code>T</code> that hold values of type <code>U</code>.</p>
  
  <p>Example of what I want to achieve:</p>
  
  <pre><code>class C {
      a: number;
      b: string;
      c: Date;
  }
  
  type DatePropOfC = PropCompatible&lt;C, Date&gt;;  // "c"
  type NumberOrStringPropOfC = PropCompatible&lt;C, number | string&gt;;  // "a" | "b"
  type AnyPropOfC = PropCompatible&lt;C, any&gt;;  // same as keyof C
  </code></pre>
  
  <p>Is this possible to achieve with TypeScript 2.8 conditional types? I've tried a few combinations can't find the right one.</p>