title: TypeScript: Reference subtype of type definition (interface)
body: <p>I am using the following type in my TypScript:</p>
  
  <pre><code>interface ExerciseData {
      id : number;
      name : string;
      vocabulary : {
          from : string;
          to : string;
      }[];
  }
  </code></pre>
  
  <p>Now I'd like to create a variable that is of the same type as the attribute <code>vocabulary</code>, trying the following:</p>
  
  <pre><code>var vocabs : ExerciseData.vocabulary[];
  </code></pre>
  
  <p>But that is not working. Is it possible to reference to a subtype somehow? Or would I have to do something like this?</p>
  
  <pre><code>interface ExerciseData {
      id : number;
      name : string;
      vocabulary : Vocabulary[];
  }
  
  interface Vocabulary {
          from : string;
          to : string;
  }
  
  var vocabs : Vocabulary[];
  </code></pre>
  
  <p>Thanks a lot for hints.</p>