title: How to extract "string" property names from an interface in Typescript?
body: <p><a href="https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgMoHkCyBRA+ugIQClsBhAFWQG8AoZe5MYMAGwgC4GGBnMKUAOYAaOgxZwARhBacuyXvxDDR9bgHsAthAJq1MhhN1s4IEV3VaAInEizk1yGZ6aIAOQCuGqVE4hP3mgBfGhowAE8ABxQAaWwATVRkAF5kAGsIMLUYNCw8QhIKAG4Q8KjkbAAPPkQwVD5BAB5yAD5ktIys5EoIKogQABNueXqlZAB+dszsyl8IADdoYtKUVHIAJQBJVwBxXFiEtsrqhFqRgQaMHHxiMhagA" rel="noreferrer">Typescript playground</a></p>
  <p>I want to extract the <code>string</code> properties from <code>SOME_OBJECT</code> and get it as a union type. Therefore, in the example below, I expect <code>STRING_KEYS</code> to be of type  <code>&quot;title&quot; | &quot;label&quot;</code></p>
  <pre><code>interface SOME_OBJECT {
      title:      string,
      label:      string,
      someBool:   boolean,
      someDate:   Date,
      someNumber: number
  }
  
  type ExtractString&lt;T&gt; = keyof T extends string ? keyof T : never;
  
  type STRING_KEYS = ExtractString&lt;SOME_OBJECT&gt;  // &lt;----- THIS SHOULD BE &quot;title&quot; | &quot;label&quot;
  </code></pre>
  <p>This is what I'm getting:</p>
  <p><a href="https://i.stack.imgur.com/PVuG5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PVuG5.png" alt="enter image description here" /></a></p>
  <p>I think I'm in the right direction here (by using conditional types), but I'm not quiet there yet. What is the best way to achieve this?</p>