title: TypeScript - using recursive generics properly
body: <p>I am trying to use recursive generics in a way I can get a lot of help from editor.</p>
  <p>Here is an example:</p>
  <pre><code>interface ServiceEndpointNode {
    self: string;
    context?: Record&lt;string, ServiceEndpointNode&gt;
  }
  
  const ServiceEndpoints: ServiceEndpointNode = {
    self: 'BASE_URL',
    context: {
      songs: {
        self: 'GET_SONGS',
        context: {
          getSong: {
            self: 'GET_SONG',
          },
          getContributors: {
            self: 'GET_CONTRIBUTORS',
          }
        }
      }
    }
  }
  
  </code></pre>
  <p>This works properly and the structure is strict, but I don't got help from the editor.  For example I want help like:</p>
  <pre><code>ServiceEndpoints.context.songs.context.getsong.self
  </code></pre>
  <p>But because I only told the typing that the context should be a string I don't really receiving help about the traversable object. I guess I need to be include some generics or something, but don't know how to achieve that. :(</p>
  <p>So I want to have to maintain this strict structure, yet get help from the editor for all the possible routes, keys, etc.</p>