title: Typechecking path tuples against nested interface
body: <p>I have an interface that represents form values. The interface will be passed as generic arg so it's not static. I guess I would just codegen it otherwise.</p>
  
  <pre><code>interface IValues {
    name: string
    nested: {
      array: string[]
      deeply: {
        value: number
      }
    }
  }
  </code></pre>
  
  <p>I would like to type check tuples that specify path into such an object.</p>
  
  <p>For example, these would pass</p>
  
  <pre><code>['nested', 'array', 0]
  ['nested', 'deeply', 'value']
  </code></pre>
  
  <p>It's definitely long shot and I don't even have an idea where to start. My guess is mapped types, but I am even confused about those :)</p>