title: How to extract "path expression" from an interface in TypeScript?
body: <p>What I want to achieve is this:</p>
  <pre><code>type Post = {
    id: number
    title: string
    author: {
      name: string
    }
    comments: {
      text: string
    }[]
  }
  
  type ExtractPathExpressions&lt;T&gt; = ???
  
  type Paths = ExtractPathExpressions&lt;Post&gt;
  // expects above got a union --&gt; 'id' | 'title' | 'author' | 'author.name' | 'comments' | `comments[${number}]` | `comments[${number}].text`
  </code></pre>
  <p>I know this is unusual... but, does anyone know what would the <code>ExtractPathExpressions</code> look like?</p>