JavaScript to TypeScript: Intellisense and dynamic members
<p>I have a JavaScript object which dynamically allows members to be bound as accessor properties to instances of the object:</p>

<p><strong>Source</strong></p>

<pre><code>function DynamicObject(obj) {
    for (var prop in obj) {
        Object.defineProperty(this, prop, {
            get: function () { return obj[prop]; },
            set: function (value) { obj[prop] = value; },
            enumerable: true,
            configurable: false
        });
    }
}
</code></pre>

<p><strong>Usage</strong></p>

<pre><code>var obj = new DynamicObject({
    name: "John Smith",
    email: "john.smith@test.net",
    id: 1
});
</code></pre>

<p>When <code>obj</code> is created, the members of the constructor parameter are bound to <code>obj</code> as accessor properties. These show up in intellisense</p>

<p><a href="https://i.stack.imgur.com/Qth5d.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Qth5d.png" alt="Intellisense for dynamic members"></a></p>

<p>I would like to know if it is possible to model this sort of behavior (including having intellisense) in TypeScript?</p>

<p><strong>Notes</strong></p>

<p>When you run this code in TypeScript, there is no intellisense becuase everything is <code>any</code>, so TypeScript doesn't really know what's going on.</p>