title: Use typescript to dynamically set class property in constructor
body: <p>I am trying create a typescript class <code>MyClass</code> with instance properties set dynamically in the constructor:</p>
  <pre><code>const myInstance = new MyClass(({
    someField: 'foo'
  }))
  
  myInstance.someField // typescript should show this as type string
  </code></pre>
  <p>How can I use typescript to create <code>MyClass</code> to show <code>someField</code> as a string property of <code>myInstance</code>?</p>
  <p>Can I use generics? Is it at all possible?</p>