How to convert a json to a typescript interface?
<p>Given a JSON output of an api:</p>
<pre><code>{
    &quot;id&quot;: 13,
    &quot;name&quot;: &quot;horst&quot;,
    &quot;cars&quot;: [{
        &quot;brand&quot;: &quot;VW&quot;,
        &quot;maxSpeed&quot;: 120,
        &quot;isWastingGazoline&quot;: true
    }]
}
</code></pre>
<p>I would like to define interfaces for typescript:</p>
<pre><code>export interface Car {
    brand: string;
    maxSpeed: number;
    isWastingGazoline: boolean;
}

export interface RaceCarDriver {
    id: number;
    name: string;
    cars: Car[];
}
</code></pre>
<p>Yet I don't want them to type them manually, I rather have a script generate them for me.</p>
<p>How can I convert json into typescript interfaces? I also don't want to use webservices like <a href="http://jvilk.com/MakeTypes/" rel="nofollow noreferrer">MakeTypes</a> or <a href="http://json2ts.com" rel="nofollow noreferrer">json2ts</a>.</p>