Map JSON object to TypeScript object automatically (Angular 2)
<p>i'm new to Typescript and javascript.
My question is: 
how from this  </p>

<p>```</p>

<pre><code>{
    "release": {
        "ref": {},
        "commits": {}
    },
    "debug": {
        "ref": {},
        "commits": {}
    },
    "feature": {
        "ref": {},
        "commits": {}
    },
    "hotfix": {
        "ref": {},
        "commits": {}
    }
}
</code></pre>

<p>```</p>

<p>map it with with Typescript using interfaces </p>

<p><code>
export interface IRepo {
    branches: IBranch; // how to make branches a of type string: IBranch dictionary? 
}
</code></p>

<p>there will be unknown number of properties like debug, release, etc, 
i want to keep them as dictionary in IRepo instance</p>

<p>i'm using this to fetch data:</p>

<p>```</p>

<pre><code>getRepo() : Observable&lt;IRepo&gt; {
    if (!this.repo) {
        return this.http.get(this._baseUrl + 'repo.json')
            .map((res: Response) =&gt; {
                this.repo = res.json();
                return this.repo;
                })
                .catch(this.handleError);
    } else {
        return this.createObservable(this.repo);
    }
}
</code></pre>

<p>```</p>