I use the following type in my TypScript:
interface ExerciseData { id : number; name : string; vocabulary : { from : string; to : string; }[]; }
Now I would like to create a variable of the same type as the vocabulary attribute, by trying the following:
var vocabs : ExerciseData.vocabulary[];
But that does not work. Is there any way to refer to a subtype? Or did I need to do something like this?
interface ExerciseData { id : number; name : string; vocabulary : Vocabulary[]; } interface Vocabulary { from : string; to : string; } var vocabs : Vocabulary[];
Thanks so much for the tips.
javascript typescript typing
Mathias bader
source share